bubibubi / JetEntityFrameworkProvider

Microsoft Access (Jet) Entity Framework provider
89 stars 26 forks source link

mdb connection seems not to be disposed after operation... #39

Closed damienmartel2 closed 5 years ago

damienmartel2 commented 5 years ago

Hello i remark that after an operation on mdb (OLEDB.4.0) the ldb is not removed so i suppose the connection is not correctly disposed...

I find this code in your library

                if (oldConnectionState != ConnectionState.Open)
                    connection.Close();

it should not be if (oldConnectionState == ConnectionState.Open) connection.Close();

thanks

bubibubi commented 5 years ago

Write few lines of code and check if the connection is disposed or not. Also, OLEDB does not dispose the connection always. You can try to call GC. Collect() to run the garbage collector.

About the code, it says that is should close the connection only if it was open by the provider. Otherwise the connection should not be touched (for shared connections)

damienmartel2 commented 5 years ago

it works with GC. Collect()

Thanks !