Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Synchronizing Hiberanate cache with database  RSS feed

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
Boost this thread!