-
Mar 5th, 2008, 11:18 PM
#1
Spring Web Flow Hibernate Concurrency
Hi,
I am using Bitronix transaction manager in my project with Hibernate 3.x Annotation on the beans.
The service layer contains @Transactional annotation.Moreover we're using Version for concurrency.
However, Hibernate somehow does NOT throw StaleObjectException even if new version record is present in the database table.
In a nutshell, multiple users can update same record.
Interesting, in the Test class I am able to re-produce the same condition and get StaleObjectException.
Any guesses why Spring web flow & Hibernate combination not doing "concurrency" check?
Appreciate your help!
R.B
-
Mar 6th, 2008, 01:51 PM
#2
Interesting, but I don't really have any idea why it's not working. I take it you're reattaching the detached object to the Hibernate session when calling back into the transactional service layer?
Erwin
-
Mar 6th, 2008, 02:10 PM
#3
Spring Web Flow Hibernate Concurrency
Hi Erwin,
Thank you for the reply.
Yes, in service layer I am saving the parent object with child objects in it.
We debugged the logs (Both Hibernate & Spring) and new transaction is started and ended every time.
The service layer class is having @Transactional annotation and I see it's "org.springframework.transaction.annotation.Transa ctional" class.But I think it is fine as it's an abstraction and SHOULD take care of Hiberate Transaction too.
Any thoughts?
Thank you,
~Ritesh
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules