Grid Error When Submitting Form

I have a form with a grid that uses a table Business Object. The user can add or remove rows from the grid manually. It is not a standard editable grid so it is not using the + or - buttons on the grid but buttons that are on the form instead. The method for this is by using datasets from reading the business object and adding or deleting rows from the table in the dataset then writing the dataset back to the business object.

 

The problem occurs when the form is loaded at a stage with existing data in the grid and the user delete and add new rows multiple time then submit. It would result in an error and from the eLog the error message is, "Concurrency violation: the DeleteCommand affected 0 of the expected 1 records.' occurred when attempting to 'MBO update'.”

 

I have googled this and it's not specific to Metastorm. Does anyone know how to resolve this?

Tagged:

Comments

  • Sounds like your are getting tripped up in transactionality. Depending on the table you are editting, the engine's own transaction could be getting in the way (for instance, eFolder/eEvent/etc).

     

    How are you running the INSERT and DELETEs on your buttons? Creating new connections may be your issue if you are using Mstm.SelectSQL().

  • I am using a grid with a table business object where you can read and write to the table without having to do sql queries. Basically you get the dataset from the busines object by using .read() and add/delete rows from the table then write it back to the business object. From searching, I think the problem is not specific to metastorm and has to do with how datasets are updated against the database in .net. The exception occurs because every time you delete a row there is an auto generated sql statement so when you add a new row and delete it again it'll try to delete a row that doesn't exist and will give you that exception error.