• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

Hibernate Updation problem

 
Greenhorn
Posts: 26
Hibernate Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am getting a strange behavior from hibernate.

The Problem is

I tried to load a login page in struts 2. This page request a stateless session bean to verify user name and password. The stateless session bean uses hibernate to fetch data from database.

Now when I change the password in the database directly and then use it to login the the change is not reflected. It recognizes old values only.

I am not able to refresh the value....
any help please....
 
Ranch Hand
Posts: 312
MS IE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should never change values in the database directly, when you are doing so, using an application that uses Hibernate or any other ORM framework. The reason being, the ORM framework maintains a cache of the database and depending on how it is configured, the values are reflected back to the database at the end-of-day or some other frequency. Now, to solve your problem, inform in advance the users about the imminent application/application-server restart, on the date/time, restart your application/application-server.
 
Prateek Jauhari
Greenhorn
Posts: 26
Hibernate Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Sir,

But This Means If In Case, I made a change in the database then I need to redeploy my whole application on the server.

I have to do this because there a few tables that might be updated, in the application there is no interface provided to update those values.

Will it be right if I create and close a session in with each function call....?
Please advice.

Thanks for the support Sir,

Regards
Prateek
 
You firghten me terribly. I would like to go home now. Here, take this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!