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
exception.



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
> 
> 
> 


-----
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland 
http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink 
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink , 
http://wiki.oracle.com/page/TopLink TopLink 
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , 
http://www.nabble.com/EclipseLink-f26430.html EclipseLink 
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence 
-- 
View this message in context: http://old.nabble.com/Batch-Writing-and-unique-key-constraint-violation-tp27948387p28002026.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top