CirrusRedOrg / EntityFrameworkCore.Jet

Entity Framework Core provider for Access database
MIT License
138 stars 38 forks source link

Connection pool always creates a new connection #250

Open beddead opened 3 months ago

beddead commented 3 months ago

The connection pool always creates a new connection if the connection string looks like the following: b.UseJet(“Driver={Microsoft Access Driver (*.mdb, *.accdb)};extendedansisql=1;Jet OLEDB: Flush Transaction Timeout=0;dbq=” + dbPath);

This works if I enter the extended parameter in lower case. But then the JET engine ignores it.

ChrisJollyAU commented 3 months ago

I don't think EFCore.Jet has full support for connection pooling yet. In fact the tests regarding that all fail (you only get a pool of 1).

Also that connection string doesn't look right. Driver and DBQ are ODBC string settings. Then we have Jet OLEDB: Flush Transaction Timeout=0 which is for Ole DB. This part will obviously be excluded when using ODBC.

Also just a note, we always set extendedansisql=1 for ODBC whether it is originally set or not

beddead commented 3 months ago

If I use

b.UseJet(“Driver={Microsoft Access Driver (*.mdb, *.accdb)};dbq=” + dbPath);

then pooling does not work too. Because it tries to find connection in pool dictionary using different connection string (with extendedansisql=1)