File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes synchronized code in the cluster server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "synchronized code in the cluster server" Watch "synchronized code in the cluster server" New topic

synchronized code in the cluster server

anil bisht
Ranch Hand

Joined: Nov 04, 2000
Posts: 81
If i synchronize a code will it work in the cluster servers.
I have two cluster server. Here i have the generating a unique file name. I check in a directory, and if the file name is present i generate a unique fine name by appending the time stamp. So this code has to be synchronized.
Now my both the servers are mapped to a sinple directory. Will my synchronized code run??. as now both the server executes its own code independendtly, will the synchronized code be synchronized or both the servers will run it own code.

Ilja Preuss

Joined: Jul 11, 2001
Posts: 14112
Synchronization doesn't work between different JVMs, only between threads in the same JVM.
Does that answer your question?

The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
I agree. Here's the link:
subject: synchronized code in the cluster server
It's not a secret anymore!