I fought for OleDbConnectiona while, trying to get him not to cache. Basically I get access to the shared database, which is being written from another application, and then I read the values ββ(checking that it is cleared after the time of the last record and the subsequent 1 second delay).
Unfortunately, this is completely unreliable.
I read (and lose my mind) how to disconnect the connection pool, and then after each possible update I do the following before connecting again:
_connection.Close();
_connection.Dispose();
_connection = null;
OleDbConnection.ReleaseObjectPool();
GC.Collect();
In addition to this, the connection string disables pooling with OLE DB Services = -2. Finally, I also changed PageTimeoutto '10' in the registry for Jet 4.0.
All these measures, unfortunately, have no effect. Now, the only thing I can think of is what Microsoft KB mentions in this article and calls JRO.JetEngine.RefreshCache. The only problem is that argument ADODB.Connection. I would prefer not to rewrite my entire database level and where the records are read by my software in order to use an obsolete COM object to have this function, but it seems that this may be the only way.
My question is that this task is currently being rewritten to use ADODB (even ADO.NET!), Is it possible to disable caching OleDbConnection?
source
share