• 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:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

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.
 
I have always wanted to have a neighbor just like you - Fred Rogers. Tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic