• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How can i avoid con-current access in java

 
Guy Belpa
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


IF my english wrong sorry.

see this code,
(this is not real code.. this is only


What i want is avoid con-current access to this method.
Becase Currently sometimes this method returns same "currentstID"
for two users!!! which spoil all program flow.

i tried



and



But no work??

Please help!!!


(this is web based (struts) application hosted in Weblogic server)

 
Rob Spoor
Sheriff
Pie
Posts: 20527
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm moving this to JDBC.
 
Guy Belpa
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
problem not clear?
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
PatienceIsAVirtue

Making that method synchronized will only work if there's only a single instance of the class that contains the method. If there are several instances then the code needs to synchronize on the same object for all instances - maybe the Class object of that class.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic