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

Synchronizing Hiberanate cache with database

 
Fawad Ali
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I have a table whose id is set to auto increment in mySQL Server. When I insert something directly to the table, the id is incremented. The problem comes when I try to get the max id through Hibernate, it gives me the previous method. I believe that Hibernate is keeping the state of the table in some kind of cache, so when we insert to the table without using hibernate, the id is incremented physically but it is not reflected in Hibernate.

Can anyone help me in this regard?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic