This project has moved. For the latest updates, please go here.

Shared table access

Sep 23, 2010 at 1:50 PM

Hi,

I have an esent instance, and two threads.  From each thread I create a new session and try to open a table.  The first thread opens the table normally and it succeeds.  The second thread opens the table after the first, this time only for reading, and it does not succeed, throwing the error JET_errTableInUse.  Is it possible to have a table open for reading and the same table open for reading/writing?

 

Thanks,

David

Sep 23, 2010 at 3:20 PM

How are you opening the table? Are you using exclusive?

Sep 24, 2010 at 8:13 AM

Sorry, it was because the second time round I was opening the table, I was using the OpenTableGrbit.ReadOnly.  This must try to open the table exclusively for reading, meaning no writers can have the table open.  Opening the table with OpenTableGrbit.None works.  What is the best way to open a table for reading only?