Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Changes made in Database not Reflected in Entity

 
Jose Campana
Ranch Hand
Posts: 339
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdi there Ranchers !

I'm experiencing a problem that's totally new to me, because I'm a JPA newcomer. Here's what's going on:

If I change a database record using MySQL's administrative Tool, And then Invoke a Session Bean that Retrieves that -Just updated-(using the admin tool) DB Record as an Entity(using JPA).... The Entity Retrieved does not reflect the changes that were made directly to the database.

A little more detail about my scenario:

I'm Invoking an Stateless Session Bean From a JSE app. This Session Bean Injects the container's Entity Manager to Retrieve the DB Record as an Entity.
A Business method on the Session Bean delivers the Entity to the Client.

Another Thing:
If I restart my App-Server (GlassFish), And Invoke my Session Bean Again, Then the changes ARE reflected to the Entity.

I don't understand How can I avoid this Issue. Could You guys please help me? I need that the changes made directly to the DB to be reflected to the Entities (Without having to re-start the Server).

That'd be it, that's my latest issue.

I hope somebody can give me a little guidance ,

Good Luck,

Jose
 
Jose Campana
Ranch Hand
Posts: 339
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nevermind,

I figured this one out myself already,



Jose
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!