aspose file tools*
The moose likes JDBC and the fly likes How can i avoid con-current access in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How can i avoid con-current access in java" Watch "How can i avoid con-current access in java" New topic
Author

How can i avoid con-current access in java

Guy Belpa
Ranch Hand

Joined: Nov 21, 2004
Posts: 41


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

Joined: Oct 27, 2005
Posts: 19543
    
  16

I'm moving this to JDBC.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Guy Belpa
Ranch Hand

Joined: Nov 21, 2004
Posts: 41
problem not clear?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39548
    
  27
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.


Ping & DNS - updated with new look and Ping home screen widget
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How can i avoid con-current access in java
 
Similar Threads
Problem with DSN less Connection with MS Access 2000
jdbc update help
Inserting/Updating BLOBs in Oracle8i using JDBC thin driver
SQL coding to add stock balance in JSP
SQLException: No more data to read from socket