none
ACE.OLEDB.16.0 causes access violation when using resource pooling RRS feed

  • Question


  • If you have resource pooling enabled and try to Open a previously closed connection after the SPTimeout has passed (default 60 seconds), ACE.OLEDB.16.0 will crash. This does not happen with ACE.OLEDB.15.0.

    Steps to reproduce:

    1.  Install the Access 2016 Runtime
    2.  Run this code:
    using System.Data.OleDb;
    namespace ConsoleApplication1
    {
    class Program
    {
    static void Main(string[] args)
    {
    string connectionString = "Provider=Microsoft.ACE.OLEDB.16.0;OLE DB Services=-1; Data Source= <dbpath>";
    var connection = new OleDbConnection(connectionString);
    connection.Open();
    connection.Close();

    System.Threading.Thread.Sleep(75000); //wait for SPTimeout

    connection.Open(); //crash
    connection.Close();
    }
    }
    }
    Tuesday, February 21, 2017 12:21 AM

All replies

  • Hi WeaverTT,

    Thanks for posting here.

    Based on your description and related code, I create a demo and reproduce your issue on my side, I encounter a exception with error message "The connection was not closed. The connection's current state is connecting", and it works fine with ACE.OLEDB.12.0, it seems that it is a data provider issue, I would suggest that you could post a feedback on the following link.

    https://connect.microsoft.com/VisualStudio/Feedback 

    Best regards,

    Cole Wu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Proposed as answer by Paul P Clement IV Tuesday, February 21, 2017 2:03 PM
    • Unproposed as answer by TrentTW Tuesday, February 21, 2017 3:11 PM
    Tuesday, February 21, 2017 2:15 AM
    Moderator
  • Here's the post for reference:

    https://connect.microsoft.com/VisualStudio/feedback/details/3124028


    Tuesday, February 21, 2017 3:11 PM
  • Here's the post for reference:

    https://connect.microsoft.com/VisualStudio/feedback/details/3124028


    Just a couple of comments:

    1) All OLEDB services are enabled by default so there is no need to specify the OLE DB Services argument.

    2) There is no need to re-use OleDbConnection objects. Connection pooling operates independently of the object instances. I would recommend creating a new instance rather than attempting to re-use an OleDbConnection that has been closed. Typically connection objects are only closed in anticipation of being destroyed.


    Paul ~~~~ Microsoft MVP (Visual Basic)

    Tuesday, February 21, 2017 6:38 PM
  • Thanks for the thoughts Paul,

    You'll see the same behavior if you create a new OleDbConneciton:

    string connectionString = "Provider=Microsoft.ACE.OLEDB.16.0;OLE DB Services=-1; Data Source=<dbpath>;Persist Security Info=False ";
    var connection = new OleDbConnection(connectionString);
    connection.Open();
    connection.Close();
    
    System.Threading.Thread.Sleep(75000); //wait for SPTimeout
    
    var connection2 = new OleDbConnection(connectionString);
    connection2.Open(); //crash
    connection2.Close();

    My concern is maintaining compatibility with existing software.

    Tuesday, February 21, 2017 7:05 PM
  • I'm facing this error and the solution was to leave the connection open all the time. So, i've opened the database once at the beginning of the application and closed once at the end. Also i have removed the OLE DB Services=-1. The provider is Microsoft.ACE.OLEDB.16.0.

    This occurred at Windows 10 64bit / Access 2016 64bit.

    Rgrds


    Isidoros MCTS VB.NET


    • Edited by Isidoros Tuesday, November 21, 2017 6:16 PM
    Tuesday, November 21, 2017 6:14 PM
  • I have to support opening & closing multiple connections due to the nature of my application, so I can't use that workaround unfortunately. All of my 32-bit client apps use JET and have no problem. All of my 64-bit clients are stuck on ACE 15.0 or 13.0 (ACE 12.0 has this problem) until Microsoft fixes this bug.

    -Trent

    Thursday, June 7, 2018 11:03 PM