Hey Gareth and Jacques,

OK, so this means the startup design is unnecessary (making the start class
a singleton). Instead we can simply declare the variables Config and
ServerState as static because any new call to the startup logic using "java
-jar ofbiz.jar" is going to launch a new JVM. This whole description at the
top of the class is hence confusing: "This class uses a singleton pattern to
guarantee that only one server instance is running in the VM". Of course
only one instance is going to run in the VM because only one ServerSocket
may be set per VM.

Anyway, things are very clear now. The start sequence only executes once per
JVM. This makes locks and all kinds of elaborate checking unnecessary. I
will start cleaning that up!

Cheers

Taher Alkhateeb

-----Original Message-----
From: Gareth Carter [mailto:gareth.car...@stannah.co.uk] 
Sent: 02 June 2016 10:58
To: dev@ofbiz.apache.org
Subject: RE: Question on multiple starting ofbiz

We have a server with multiple instances of ofbiz running using port offset.
But these are completely separate java processes, separate classloaders and
locks etc

You would not even be able to start the same instance multiple times (maybe
POS?), port numbers would be in use unless you change the port offset

It could that the developer who created the code did so out of habit, ofbiz
may work exactly the same with or without it

-----Original Message-----
From: Jacques Le Roux [mailto:jacques.le.r...@les7arts.com]
Sent: 02 June 2016 8:38 AM
To: dev@ofbiz.apache.org
Subject: Re: Question on multiple starting ofbiz

OOTB, because of the admin port I don't know of any ways to start OFBiz
multiple time.

The both option only allows to start the POS and the rest, but for the same
reason only one time.

It could be that this was introduced for external projects, then please
chime in...

Jacques

Le 02/06/2016 à 08:34, Taher Alkhateeb a écrit :
> Hello Folks,
>
>   
>
> My question is the following: is OFBiz allowed to start multiple times 
> from the main method (difference tenants, different offset ports,
whatever.)?
>
>   
>
> The reason I ask is because the startup logic in OFBiz is made more 
> complex because it assumes multiple starts. For example:
>
> -          Checking if a classloader is set or not
>
> -          Applying locks on StartupLoaders to prevent multiple threads
from
> altering them
>
>   
>
> Is this code unnecessary? Should I assume that OFBiz never calls the 
> startup sequence more than once?
>
>   
>
> Regards,
>
>   
>
> Taher Alkhateeb
>
>   
>
>   
>
>



To report this email as spam, please send the original message, complete
with headers to s...@websense.com


This email is intended only for the above addressee. It may contain
privileged information. If you are not the addressee you must not copy,
distribute, disclose or use any of the information in it. If you have
received it in error, please delete it and notify the sender.

Stannah Lift Holdings Ltd registered No. 686996, Stannah Management Services
Ltd registered No. 2483693, Stannah Lift Services Ltd registered No.
1189799, Stannah Microlifts Ltd registered No. 964804, Stannah Lifts Ltd
registered No. 1189836, Stannah Stairlifts Ltd registered No. 1401451.

All registered offices at Watt Close, East Portway, Andover, Hampshire, SP10
3SD, England.

All Registered in England and Wales.

This message has been scanned for malware by Websense. www.websense.com

Reply via email to