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

Hibernate re-writting dirty data

 
Kris Reid
Ranch Hand
Posts: 247
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

So I've got a web application that is working perfect reading and writing the DB.
I also have a background process that reads and updates a table every minute then goes to sleep.

When it does the read it has the old objects. It hasn't read the new changes from the DB and I can't seem to force it to.

Any ideas?


Here is the code

 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where is your transaction boundary (i.e. where do you begin and end your transaction)?
 
Kris Reid
Ranch Hand
Posts: 247
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Hibernate synchronizer

The only line above what I have show is
_RootDAO.initialize();


I figured a new DAO would be in a new transaction
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I figured a new DAO would be in a new transaction

I think it should be - worth checking the synchronizer documentation though. The behaviour you see sounds like a transaction issue.

 
Kris Reid
Ranch Hand
Posts: 247
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic