Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting wrong record back  RSS feed

 
Jeff Horan
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OracleAS, Oracle9i, ejb(SB->dao)
I can duplicate this problem when 3 people are quickly updating a record then returning to a resultset (list), go to a populated page, change something and updating again. After 5 mins, pretty consistently, I get the record that someone else was trying to retrieve, and they get mine. Then, if we keep on trying to get any record (by PK) the same (wrong) one comes back as if the backend were choking. After no activity for a couple of minutes the app is back to normal.

Is there any terminology for this so that my search for a solution will be more productive?
And what the heck should I be looking for?
The SB used to go to an EB, but since this is a local environment I eliminated the EB and have the SB go directly to the dao. However, that didn't change the symptoms. The SB has container managed transactions defined, so why is this happening?
There are no static vars.
The problem is narrowed down to one line in the Action class where a class calls the SB findbyPK (composite key of 3 fields) method. When it returns, it returns with someone else's record.
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suspect your client code is not thread safe. Check that an object which is accessed concurrently (like a servlet or maybe your Action) has class or instance variables which are not final. If they are not final, then either make them final or convert them to local variables.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!