my dog learned polymorphism*
The moose likes EJB and other Java EE Technologies and the fly likes How to Update the entity in ejb3.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "How to Update the entity in ejb3.0" Watch "How to Update the entity in ejb3.0" New topic
Author

How to Update the entity in ejb3.0

V.N.T.Deepak Solasa
Greenhorn

Joined: May 29, 2007
Posts: 16
I am using ejb3.0,I have one entity bean .Suppose ,if i open 2 browsers parallely and in one browser i am trying to do update my record by using edit functionality using entityManager.merge(),the value getting updated in the entity.Now if i am trying to view the same record in another browser which is already opened the entity is showing the old value instead of the new value.ofcourse i have done this even by refreshing the page .

please suggest me
Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 2057
Originally posted by V.N.T.Deepak Solasa:
I am using ejb3.0,I have one entity bean .Suppose ,if i open 2 browsers parallely and in one browser i am trying to do update my record by using edit functionality using entityManager.merge(),the value getting updated in the entity.Now if i am trying to view the same record in another browser which is already opened the entity is showing the old value instead of the new value.ofcourse i have done this even by refreshing the page .

please suggest me


It can be somewhere on the lines of, the update not committed yet, or the retrieval is getting it from a cache or buffer. If you close the 2nd browser and reopen it instead of just refreshing it, does the new data come out?
V.N.T.Deepak Solasa
Greenhorn

Joined: May 29, 2007
Posts: 16
Hi Angeles ,

Thanks for your response.yes,if i am closing the browser and open it again it is showing the updated records.
Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 2057
Originally posted by V.N.T.Deepak Solasa:
ofcourse i have done this even by refreshing the page .



When you say 'refreshing', I assume you mean going back to the server and reading again from the table/ejb right? Or just pressing 'refresh' button of browser? If it is the latter, then it is not an ejb issue, it is your html.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How to Update the entity in ejb3.0