|
Re: OptimisticLockException activated batch-writing [message #1817228 is a reply to message #1816818] |
Mon, 18 November 2019 16:43   |
Chris Delahunt Messages: 1389 Registered: July 2009 |
Senior Member |
|
|
EclipseLink does not have support for getting the object, but the SQL itself is logged so you could add support for getting the set of parameters involved with the failure with a bit of digging. I would guess this is platform dependent though, as Oracle classes have their own slightly different behaviour where the OracleStatement sendBatch only returns the row count.
The org.eclipse.persistence.internal.databaseaccess.DatabasePlatform executeBatch method returns a single int, but could return the int[] from the driver. This could then be used within the calling org.eclipse.persistence.internal.databaseaccess.ParameterizedSQLBatchWritingMechanism executeBatch method which has an array of parameters used in the batch that would line up with the int[] results. You would need to go through the count to find one that returned 0, and match it up to the entry in the parameter list to get the first set that would cause an optimistic lock exception, and then throw the error appropriately.
Best Regards,
Chris
[Updated on: Mon, 18 November 2019 16:44] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.02359 seconds