• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Spring Hibernate Cluster problem

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

We are trying to implement Session Clustering using Spring & Hibernate deployed on Oracle10gAS 10.1.2.0.2. There are two OC4J servers configured for session clustering. On fail over request is successfully going to another one. For simple plain JSP application HTTP session build on first machine is available on second oc4j machine.

But session clustering is not working fine with application built using Hibernate and Spring. If both nodes are available then things work fine, when one node goes down then request goes to another server but hibernate pojo object are not in Synch (may be), or due to whatever reason we are getting below stack trace:

Exception while executing action
org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException:

Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect):
[FishingLicense#35965]; nested exception is org.hibernate.StaleObjectStateException:

Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [FishingLicense#35965]
org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [FishingLicense#35965]






Can any one provide me some hints regarding this issue?
[ May 13, 2007: Message edited by: Adnan Badar ]
 
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Adnan,

This is not a clustering issue and it probably has more to do with stale data. This could happen for example if you�re using graphs of objects when modeling parent-child relationship. Supposing you have an item that has a list of bids and you change something about the item and save the item only, hibernate will also try to save the list of bids (if the relationship�s cascade attribute is set accordingly). On the other hand if another transaction would alter any of the bids within the collection then Hibernate will issue a StaleDataException, which I�m only guessing is wrapped by this HibernateOptimisticLockingFailureException spring runtime exception.

I hope this will help.

Regards.
 
It's a beautiful day in this neighborhood - Fred Rogers. Tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!