Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to Update the entity in ejb3.0

 
V.N.T.Deepak Solasa
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2068
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2068
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic