| Author |
need help getting changes in the database reflected in session
|
caleb momanyi
Ranch Hand
Joined: Jun 17, 2012
Posts: 43
|
|
|
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
internet detective
Marshal
Joined: May 26, 2003
Posts: 26218
|
|
|
You can poll the database. Or query right before using the session data. Or set up caching to expire after a short time.
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
caleb momanyi
Ranch Hand
Joined: Jun 17, 2012
Posts: 43
|
|
|
can you please give me an example of how to set expiry of the cached data
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26218
|
|
|
See this article for an example.
|
 |
caleb momanyi
Ranch Hand
Joined: Jun 17, 2012
Posts: 43
|
|
|
Thank you very much, I now get it. I just do a findAll() after persisting an entity. And it works
|
 |
 |
|
|
subject: need help getting changes in the database reflected in session
|
|
|