Wednesday, June 16, 2010

"File sharing lock count exceeded…" error message during large transaction processing

Image representing Microsoft as depicted in Cr...Image via CrunchBase
I've been working on a project that combines 21 Access databases all containing tables with the same names into a single database containing those common tables wilthat data from all the databases inside. I then have have to fix the ID field for each database and sort the database using SQL Commands. the tables get real big and I kept running into an error; " File sharing lock exceeded. Increase MaxLocksPerFile registry entry.." So I followed the following link and tried out the advice.

"File sharing lock count exceeded…" error message during large transaction processing

 Things improved but the error kept coming up.  It turns out that the code was running faster than the SQL could be ran. So I put pauses for 30 seconds to make the software to wait for the SQL statements to finish.

System.Threading.Thread.Sleep(30000)

Much better. But i think encasing my SQL in Transactions might be a better way to go. Here is what  I will use if I end up using Transactions.


Enhanced by Zemanta

No comments:

Post a Comment