Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Serialized object as Class level variable

 
PankajKumar Pitaliya
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi All,

I am using Hibernate in my web application as a persistence framework.

I am facing an issue in my project, wherein two application user updating two different data object. But, while click on submit, one data object was updated/overwritten over another data object.

when i analyzed the issue. i cam to know that i have used Serialiazed object as a Class level variable, which in turn going to Database for updation.

My Question is:

If we put Serialized object as class level variable, How will it behave if there are two different session?
 
Javid Jamae
Author
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think that having a serialized object makes a difference with respect to database isolation. The isolation level is set on the driver. You can either change your isolation level, or you can look into optimistic concurrency control using Hibernate's versioning feature. I would lean towards using versioning.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic