XPages: Inserting new row throws error javax.sql.rowset.spi.SyncProviderException: 1 conflicts while synchronizing

244 views Asked by At

I am getting an error while trying to insert a new record to a SQL table using the following code.

jdbcRowSet1.saveRow(objectData);
jdbcRowSet1.acceptChanges();

The issue is because of a trigger that fires after INSERT that tries to set a primary key value (Column name ID) with an auto generated ID (Column name ID_AUTO). Both columns are in the same table. If that trigger is deleted, the code works just fine.

Is there anything that can be done to the xpages code to avoid the error (The error says "1 conflicts while synchronizing"). The error happens at the acceptChanges() line.

EDITED:

I took care of the above mentioned issue. But now my next issue is getting the auto generated ID value back after inserting the new row. Please let me know if anybody knows.

0

There are 0 answers