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