• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Spring Hibernate Cluster problem

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
This cake looks terrible, but it tastes great! Now take a bite out of this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic