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

[ADO.NET] method "DbConnection.OpenAsync ()" and "DbConnection.OpenAsync (CancellationToken)" are not supported

    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

      According to msdn standard:
      http://msdn.microsoft.com/en-us/library/hh223688.aspx
      and
      http://msdn.microsoft.com/en-us/library/hh223693.aspx, method "DbConnection.OpenAsync ()" and "DbConnection.OpenAsync (CancellationToken)" are required methods. But CUBRID ADO.NET does not support them now.

        Activity

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

        add new interface: OpenAsync() OpenAsync(CancellationToken)

        Show
        cn15800 谢韦华[Bert] added a comment - add new interface: OpenAsync() OpenAsync(CancellationToken)
        Hide
        cn15800 谢韦华[Bert] added a comment -

        OpenAsync()

        {code}
        conn_l.OpenAsync();
        while (conn_l.State != ConnectionState.Open )
        {
        Console.WriteLine("connecting....,{0}", conn_l.State);
        //do something
        System.Threading.Thread.Sleep(1000);
        }
        Console.WriteLine("connect successful....,{0}", conn_l.State);{code}
        Show
        cn15800 谢韦华[Bert] added a comment - OpenAsync() {code} conn_l.OpenAsync(); while (conn_l.State != ConnectionState.Open ) { Console.WriteLine("connecting....,{0}", conn_l.State); //do something System.Threading.Thread.Sleep(1000); } Console.WriteLine("connect successful....,{0}", conn_l.State);{code}
        Hide
        cn15800 谢韦华[Bert] added a comment - - edited

        OpenAsync(CancellationToken)

        {code}
        CancellationTokenSource cts = new CancellationTokenSource();
        conn_l.OpenAsync(cts.Token);


        while (conn_l.State != ConnectionState.Open )
        {
        Console.WriteLine("connecting....,{0}", conn_l.State);
        System.Threading.Thread.Sleep(1000);
        cts.Cancel();
        if (conn_l.State == ConnectionState.Closed)
        { Console.WriteLine("Cancel...."); break; }
        }{code}
        Show
        cn15800 谢韦华[Bert] added a comment - - edited OpenAsync(CancellationToken) {code} CancellationTokenSource cts = new CancellationTokenSource(); conn_l.OpenAsync(cts.Token); while (conn_l.State != ConnectionState.Open ) { Console.WriteLine("connecting....,{0}", conn_l.State); System.Threading.Thread.Sleep(1000); cts.Cancel(); if (conn_l.State == ConnectionState.Closed) { Console.WriteLine("Cancel...."); break; } }{code}
        Hide
        ryin005 Ray Yin added a comment -
        • Test OS: Windows 32/64 bits
        • CUBRID: 9.2.0.0155
        • Driver: cubrid-ado.net 9.2.0.0002
        • .NET 4.0

        Test Result: Pass

        The issue could be closed

        Show
        ryin005 Ray Yin added a comment - Test OS: Windows 32/64 bits CUBRID: 9.2.0.0155 Driver: cubrid-ado.net 9.2.0.0002 .NET 4.0 Test Result: Pass The issue could be closed
        Hide
        ryin005 Ray Yin added a comment -

        Since the driver needs to support VC2008, OpenAsync(CancellationToken) is removed from ADO.NET 9.2.0.0002 (2013-11-08)

        Show
        ryin005 Ray Yin added a comment - Since the driver needs to support VC2008, OpenAsync(CancellationToken) is removed from ADO.NET 9.2.0.0002 (2013-11-08)

          People

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

            Dates

            • Created:
              Updated:
              Resolved: