in

System.Data.SQLite

An open source ADO.NET provider for the SQLite database engine

Concurrency Violation on update - can you help?

Last post 12-28-2010 7:22 PM by Turar. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 01-31-2009 9:49 AM

    Concurrency Violation on update - can you help?

    Hi,

     Thanks so much for your awesome database engine!  I'm having a problem and I am really hoping someone can help.  I am getting a "Concurrency Violation" when I try to update a row in my table.  I have built a sample app to demonstrate the problem - it is a Visual Studio 2008 project using the latest build of System.Data.SQLite.  When I debug the program - hit the "Start" button on the form - I get the message below, and I really am not sure why.  Any help is greatly appreciated!  Please see "testapp.zip" which is attached to this post.

     System.Data.DBConcurrencyException was unhandled
      Message="Concurrency violation: the UpdateCommand affected 0 of the expected 1 records."
      Source="System.Data"
      RowCount=1
      StackTrace:
           at System.Data.Common.DbDataAdapter.UpdatedRowStatusErrors(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[ batchCommands, Int32 commandCount)
           at System.Data.Common.DbDataAdapter.UpdatedRowStatus(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[ batchCommands, Int32 commandCount)
           at System.Data.Common.DbDataAdapter.Update(DataRow[ dataRows, DataTableMapping tableMapping)
           at System.Data.Common.DbDataAdapter.UpdateFromDataTable(DataTable dataTable, DataTableMapping tableMapping)
           at System.Data.Common.DbDataAdapter.Update(DataTable dataTable)
           at SQLiteTestApp.Form1.btnStart_Click(Object sender, EventArgs e) in C:\Users\Mike\Documents\Visual Studio 2008\Projects\SQLiteTestApp\SQLiteTestApp\Form1.cs:line 46
           at System.Windows.Forms.Control.OnClick(EventArgs e)
           at System.Windows.Forms.Button.OnClick(EventArgs e)
           at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
           at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
           at System.Windows.Forms.Control.WndProc(Message& m)
           at System.Windows.Forms.ButtonBase.WndProc(Message& m)
           at System.Windows.Forms.Button.WndProc(Message& m)
           at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
           at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
           at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
           at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
           at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
           at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
           at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
           at System.Windows.Forms.Application.Run(Form mainForm)
           at SQLiteTestApp.Program.Main() in C:\Users\Mike\Documents\Visual Studio 2008\Projects\SQLiteTestApp\SQLiteTestApp\Program.cs:line 17
           at System.AppDomain._nExecuteAssembly(Assembly assembly, String[ args)
           at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[ args)
           at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
           at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
           at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
           at System.Threading.ThreadHelper.ThreadStart()
      InnerException:
     

  • 02-22-2009 1:27 PM In reply to

    Re: Concurrency Violation on update - can you help?

     friendly bump.... any ideas anyone?

  • 02-22-2009 4:14 PM In reply to

    Re: Concurrency Violation on update - can you help?

    Working on a fix for this and several other issues for a release late this week.

  • 04-06-2009 4:42 AM In reply to

    Re: Concurrency Violation on update - can you help?

     Is it solved?

    There is a Beta or something else, with this bug fixed?

    Thanks in advance

    Fabio

  • 04-11-2009 9:36 PM In reply to

    Re: Concurrency Violation on update - can you help?

    I'm having the same or very similar problem, using the latest release with C# in VS2005.   If I use a command builder to generate the update command, it throws this error any time the first data row is edited - and fails to update that row.   If I generate the update query in text with parameters, it works fine.

  • 07-26-2010 2:06 AM In reply to

    • aoyama
    • Top 500 Contributor
    • Joined on 10-09-2008
    • Posts 4

    Re: Concurrency Violation on update - can you help?

    The problem has not been fixed in the latest release (1.0.66.0). 

    The same exception occurs in two_wheel's sample app.

    http://sqlite.phxsoftware.com/forums/storage/5/6909/testapp.zip

  • 12-28-2010 7:22 PM In reply to

    • Turar
    • Not Ranked
    • Joined on 12-20-2010
    • Posts 4

    Re: Concurrency Violation on update - can you help?

     Same problem here. Is there a workaround? 

Page 1 of 1 (7 items)
Powered by Community Server (Commercial Edition), by Telligent Systems