• Post Reply Bookmark Topic Watch Topic
  • New Topic

need help getting changes in the database reflected in session

 
caleb momanyi
Ranch Hand
Posts: 43
Firefox Browser Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ranchers. How do you get changes made in the database to reflect in the application without reloading the application as it is the case with my application. I am using JPA i don't know if that is enough information to go by because i have no idea what code to post here. Thank you in advance
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35709
408
Eclipse IDE Java VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can poll the database. Or query right before using the session data. Or set up caching to expire after a short time.
 
caleb momanyi
Ranch Hand
Posts: 43
Firefox Browser Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you please give me an example of how to set expiry of the cached data
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35709
408
Eclipse IDE Java VI Editor
 
caleb momanyi
Ranch Hand
Posts: 43
Firefox Browser Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much, I now get it. I just do a findAll() after persisting an entity. And it works
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!