Re: OleDbException: Could not update; currently locked
- From: "Jim Hughes" <NOSPAMJ3033@xxxxxxxxxxx>
- Date: Wed, 30 Aug 2006 10:54:08 -0700
Are you using one connection or multiple?
Under the hood, the OleDB .Net provider is still using Jets OleDB provider.
The following article might shed some light.
"Every ADO connection that uses the Jet OLE DB Provider maintains an
independent Jet session. This results in a delay between writes on one
connection being read on a second connection, even if you have two
connections in the same database application.
This asynchronous write/read behavior is by design. Microsoft Jet uses a
page buffering system to provide enhanced database performance and this page
buffering system cannot be turned off.
To demonstrate Jet's delayed write/read behavior when using independent ADO
connections, run the following code from a button in a simple VB form:"
http://support.microsoft.com/kb/200300/
"Luke Neumann" <lukas.neumann@xxxxxxxxx> wrote in message
news:1156930032.698899.65950@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Yes, that what I did too - it just tries again after a while. But it is
not solution of the problem, it just hides it. I'd like at least like
to know what is cause of this error...
Lukas
Gordon wrote:
Could part of your routine open the table and then stumble but try to
continue on.
This happened to me recently so I had to add code to close and reopen my
table in case part of my routine failed.
Just a thought.
--
Gordon
"Luke Neumann" wrote:
Hello,
I have a standalone windows application that uses MS Jet 4.0 to read
and write from MS Access database.
Rather randomly, I keep getting this exception:
System.Data.OleDb.OleDbException: Could not update; currently locked.
at System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(Int32
hr) at
System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS
dbParams, Object& executeResult) at
System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object&
executeResult) at
System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior,
Object& executeResult) at
System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior
behavior, String method) at
System.Data.OleDb.OleDbCommand.ExecuteNonQuery() at
AccessDataInterface.AccessItemStore.SaveItem(OutlookItem item, Int32
attemptNumber)
I tried to protect the ExecuteNonQuery method using Mutex class to
ensure that only one thread can execute this at the same time, but it
didn't help.
Any ideas?
Thanks
Lukas Neumann
.
- References:
- OleDbException: Could not update; currently locked
- From: Luke Neumann
- Re: OleDbException: Could not update; currently locked
- From: Luke Neumann
- OleDbException: Could not update; currently locked
- Prev by Date: Re: ADODB and .Net
- Next by Date: Re: why ever use structs vrs. classes?
- Previous by thread: Re: OleDbException: Could not update; currently locked
- Next by thread: RE: Data Adaptor error VB.Net 2003 SQL 2005 - SOLVED
- Index(es):