-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Constranints violation in hibernate batch update
PostPosted: Fri Sep 03, 2010 6:35 am 
Newbie

Joined: Fri Sep 03, 2010 5:58 am
Posts: 1
I am using EJb 3 with hybernate. I have a entity called ApplicationForm and another Entity called ClassGroup; the relationship between these two is @ManyToMany(cascade = { CascadeType.ALL }, fetch = FetchType.EAGER). I have a "save(ApplicationForm a)" metod that calls the entitymanager's save operation. I have flex front end button that triggers this method.
When i hit that button few times(10 times) within short time(5sec) i get an error saying batch update fail due to constraints violation. The reason for this error is two insert statement try to insert the same key values to the associate table created as a result of @ManyToMany relationship. I am not clear about these points

1) Why hibernate perform batch operation when i hit the button many time
2) How the same entity is used and managed between different transactions
3) What remedies can i take to prevent from this error.
4) What is the effect of "hibernate.jdbc.batch_size" on this error

can anyone please explain these points. Thank you


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.