Skip to main content

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

The only information we get back from the database is contained in the JDBC

patric-5 wrote:
> Hello,
> 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,
> Patric

----- James Sutherland
 EclipseLink ,
Wiki: EclipseLink , TopLink 
Forums: TopLink , EclipseLink 
Book: Java Persistence 
View this message in context:
Sent from the EclipseLink - Users mailing list archive at

Back to the top