Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Batch Writing and unique key constraint violation


I have a question when writing many entities to the database (using jdbc batch). Because of performance reasons I am commiting in "groups" (let's say every 100 entities).

The table to which the entity belongs has several unique key constraints defined. It may be the case that some entities of a group matches the same unique key and hence the commit will fail, due to unique key violation.

My question: Is there any way to retrieve the entity/ies (or the unique key combination) which caused the violation?

(A "commit size" of 1, a flush after each insert, or a select-before-insert are no options for me)

Thank you!

Best regards,

Back to the top