RE: load balancing and synchronization

2001-04-02 Thread GOMEZ Henri

>if i do load balancing with tomcat (w/ mod_jk), what happens 
>if the two tomcat servers at the same time execute a 
>synchronized method? 

With mod_jk, even in load balancing mode, a request is allways
sent a a SINGLE tomcat !

>will they know that they mustn't execute 
>it concurrently or not? if synchronization worked only per 
>JVM, would there be a workaround?

The Tomcat didn't (and must'nt) know about others tomcats

>thanks,
>
>-nico
>
>
>Nico Wieland
>
>NETVERTISING AGAgentur fuer zeitgerechte Kommunikation
>Samariterstrasse 5, CH 8032 Zuerich
>Telefon +41 1 267 11 11,  Fax +41 1 267 11 99
>mailto:[EMAIL PROTECTED]  http://www.netvertising.ch
>
>



RE: load balancing and synchronization

2001-04-02 Thread William Kaufman

Synchronization does only work per-JVM.  (Consider that you're synchronizing
on an object: that same object cannot possibly appear in two different
JVMs.)

The only work-around is to do locking yourself, using some resource (like a
file, a database, a servlet, or an RMI server) which is accessible from all
server machines/processes.

-- Bill K.


> -Original Message-
> From: Nico Wieland [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 02, 2001 8:40 AM
> To: [EMAIL PROTECTED]
> Subject: load balancing and synchronization
> 
> 
> hi list
> 
> if i do load balancing with tomcat (w/ mod_jk), what happens 
> if the two tomcat servers at the same time execute a 
> synchronized method? will they know that they mustn't execute 
> it concurrently or not? if synchronization worked only per 
> JVM, would there be a workaround?
> 
> thanks,
> 
> -nico
> 
> 
> Nico Wieland
> 
> NETVERTISING AGAgentur fuer zeitgerechte Kommunikation
> Samariterstrasse 5, CH 8032 Zuerich
> Telefon +41 1 267 11 11,  Fax +41 1 267 11 99
> mailto:[EMAIL PROTECTED]  http://www.netvertising.ch
> 
> 



load balancing and synchronization

2001-04-02 Thread Nico Wieland

hi list

if i do load balancing with tomcat (w/ mod_jk), what happens if the two tomcat servers 
at the same time execute a synchronized method? will they know that they mustn't 
execute it concurrently or not? if synchronization worked only per JVM, would there be 
a workaround?

thanks,

-nico


Nico Wieland

NETVERTISING AGAgentur fuer zeitgerechte Kommunikation
Samariterstrasse 5, CH 8032 Zuerich
Telefon +41 1 267 11 11,  Fax +41 1 267 11 99
mailto:[EMAIL PROTECTED]  http://www.netvertising.ch