aspose file tools
The moose likes EJB and other Java EE Technologies and the fly likes need help getting changes in the database reflected in session Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Reply Bookmark "need help getting changes in the database reflected in session" Watch "need help getting changes in the database reflected in session" New topic
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
    
  66

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
    
  66

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
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: need help getting changes in the database reflected in session
 
Similar Threads
Hibernate caching- Which caching to use for performance ?
Servlet version compatibility
Local webapp users
use OOP to design database tables schema?
Does committing transaction closes session?