This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Unable to catch the java.sql.BatchUpdateException (Spring) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Unable to catch the java.sql.BatchUpdateException (Spring)" Watch "Unable to catch the java.sql.BatchUpdateException (Spring)" New topic
Author

Unable to catch the java.sql.BatchUpdateException (Spring)

nivedan Nat
Greenhorn

Joined: Jul 22, 2011
Posts: 2
Hi All,

I use Hibernate with Spring. I have marked a table called Person with First_Name and Last_Name as unique. I used Springs transaction manager and have marked the service layer method to rollback for Exception.class

I can see that the create(Person person) works and Spring is able to catch if a unique constraint violation happens. However my update(Person) which is exactly of same nature does not. The update code completes and somewhere down the line I get a strack trace such as this.





Why does it work for create though? How is update's transaction different from create. ? Is there anything else that needs to be configured via annotation or in the applicationContext.xml?

Any thoughts will be helpful.

cheers
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to catch the java.sql.BatchUpdateException (Spring)
 
Similar Threads
Simple Hibernate Help (Im Noob)
elt field
Hibernate + Truncate a table
MySQL, Hibernate, and allowNanAndInf Flag
Deleting data from multiple tables?