Win a copy of Head First Android this week in the Android forum!

nivedan Nat

Greenhorn
+ Follow
since Jul 22, 2011
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by nivedan Nat

Hi

But adding FetchType.Eager defeats the purpose of Lazy Loading. Depends where your using this object, probably associate the entity into session so that lazy loading can happen.
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