Uploaded image for project: 'CUBRID APIs'
  1. CUBRID APIs
  2. APIS-492

[ADO.NET] the value of connectionTimeout is not used by a connection

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: ADONET-8.4.3, ADONET-9.1.0
    • Fix Version/s: ADO.NET 9.2.0.0002
    • Component/s: ADO.NET
    • Labels:

      Description

      Description:
      The value of connectionTimeout is not used by a connection. If I set the connection timeout as 40 seconds by using "SetConnectionTimeout (40)", then open a connection, a exception is thrown almost immediately, instead of 40 seconds later.

      CUBRIDConnection.SetConnectionTimeout (int value) seems just set the connTimeout's value, and after that this value is not used when open a connection.

        Activity

        Hide
        cn15800 谢韦华[Bert] added a comment -

        can you offer your test case code? thank you.

        Show
        cn15800 谢韦华[Bert] added a comment - can you offer your test case code? thank you.
        Hide
        cn15800 谢韦华[Bert] added a comment -

        This value is that specifies the amount of time after which a synchronous receive or send call will time out.

        It is not connect's timeout.

        Msdn:http://msdn.microsoft.com/en-us/library/System.Net.Sockets.Socket_properties(v=vs.85).aspx

        If connection is synchronization, ado.net doesn't offer method to change connect's timeout, we can only set send or recv timeout

        Show
        cn15800 谢韦华[Bert] added a comment - This value is that specifies the amount of time after which a synchronous receive or send call will time out. It is not connect's timeout. Msdn: http://msdn.microsoft.com/en-us/library/System.Net.Sockets.Socket_properties(v=vs.85).aspx If connection is synchronization, ado.net doesn't offer method to change connect's timeout, we can only set send or recv timeout
        Hide
        cn15800 谢韦华[Bert] added a comment -

        function Connect:

        1. Asynchronou connect database
        2 wait for signal(connect successful or failed)
        3. If connect failed
        3.1 pass time<connTimeout, reconnect
        3.2 pass time>connTimeout, throw exception

        Show
        cn15800 谢韦华[Bert] added a comment - function Connect: 1. Asynchronou connect database 2 wait for signal(connect successful or failed) 3. If connect failed 3.1 pass time<connTimeout, reconnect 3.2 pass time>connTimeout, throw exception
        Hide
        cn15800 谢韦华[Bert] added a comment -

        a problem:

        SetConnectionTimeout(connTimeout) // or other value

        If pass time>connTimeou and system doesn't return result signal of connect, driver will cancel the connection and report "connect time out."

        I have test many times when connTimeout==5, we will get different exception:

        1) default exception: connect time out
        2) System exception:CUBRID.Data.CUBRIDClient.CUBRIDException: 由于目标计算机积极拒绝,无法连接。

        If connTimeout is very big,for example 30, It is highly unlikely that driver throw default exception

        Show
        cn15800 谢韦华[Bert] added a comment - a problem: SetConnectionTimeout(connTimeout) // or other value If pass time>connTimeou and system doesn't return result signal of connect, driver will cancel the connection and report "connect time out." I have test many times when connTimeout==5, we will get different exception: 1) default exception: connect time out 2) System exception:CUBRID.Data.CUBRIDClient.CUBRIDException: 由于目标计算机积极拒绝,无法连接。 If connTimeout is very big,for example 30, It is highly unlikely that driver throw default exception
        Hide
        cn15800 谢韦华[Bert] added a comment -

        The interface affect Open() only, can't affect OpenAsync().

        This is not standard Interface.

        Msdn:
        http://msdn.microsoft.com/en-us/library/system.data.common.dbconnection_methods(v=vs.110).aspx

        Show
        cn15800 谢韦华[Bert] added a comment - The interface affect Open() only, can't affect OpenAsync(). This is not standard Interface. Msdn: http://msdn.microsoft.com/en-us/library/system.data.common.dbconnection_methods(v=vs.110).aspx

          People

          • Assignee:
            cn15800 谢韦华[Bert]
            Reporter:
            cn15701 cuiman
            CC (Referrer):
            cuiman, Kai Yang (Inactive), 李应
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: