Sheldon Ross wrote:

 public synchronized void doPerform(RunData data, Context context){
 // do large query
> return;
>}

That's the short way to write it. This is a longer way:

public void doPerform(RunData data, Context context){
synchronize (this) {
// do large query
   return;
 }
}

In other words, it requires a lock on the "this" object, which in this case is Turbine's system-wide singleton instance of your class. It does not consult the method parameters for this purpose.

 The goal is to have the methods safe for a particular session, but
 allow multiple sessions to access the methods at the same time.

You want to synchronize your session-level objects. How you do this would depend on how you access session data.

You may wish to create a new Session-level tool that handles all session-based logic, and then make all its methods synchronized.

Shane

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to