HSQLDB: How to check if Server implementation is already running ? - JDBC JAVA
This is a discussion on HSQLDB: How to check if Server implementation is already running ? - JDBC JAVA ; I created application which start new Server() from a code and it use only
one database. But if I start another implementation of my application (it is
another main method) it is not neccessary to create another Server but it ...
-
HSQLDB: How to check if Server implementation is already running ?
I created application which start new Server() from a code and it use only
one database. But if I start another implementation of my application (it is
another main method) it is not neccessary to create another Server but it is
enough to add new database (database.0 ... n). How to know that one Server
is already running ?
-
Re: HSQLDB: How to check if Server implementation is already running ?
Hello, Dado!
You wrote on Sun, 20 Aug 2006 19:36:29 +0200:
D> I created application which start new Server() from a code and it use
D> only one database. But if I start another implementation of my
D> application (it is another main method) it is not neccessary to
D> create another Server but it is enough to add new database
D> (database.0 ... n). How to know that one Server is already running ?
Use Singleton pattern.
With best regards, Stepan Mozyra
-
Re: HSQLDB: How to check if Server implementation is already running?
Stepan Mozyra wrote:
> D> I created application which start new Server() from a code and it use
> D> only one database. But if I start another implementation of my
> D> application (it is another main method) it is not neccessary to
> D> create another Server but it is enough to add new database
> D> (database.0 ... n). How to know that one Server is already running ?
>
> Use Singleton pattern.
To me it sounds as if the original poster is starting
two programs (as in different JVM's).
Arne
-
Re: HSQLDB: How to check if Server implementation is already running ?
"Arne Vajhoj" <arne@vajhoej.dk> je napisao u poruci interesnoj
grupi:fT6Gg.3850$_q4.2540@dukeread09...
> Stepan Mozyra wrote:
>> D> I created application which start new Server() from a code and it use
>> D> only one database. But if I start another implementation of my
>> D> application (it is another main method) it is not neccessary to
>> D> create another Server but it is enough to add new database
>> D> (database.0 ... n). How to know that one Server is already running ?
>>
>> Use Singleton pattern.
>
> To me it sounds as if the original poster is starting
> two programs (as in different JVM's).
>
> Arne
Yes of course, if you started application twice you got 2 different JVM. Is
something wierd with that ? Can I use Singelton once in 2 or more different
JVM-s ? I mean, I don't think that Singelton will know if some class
(Server for example) is instanced once in all JVM-s.
-
Re: HSQLDB: How to check if Server implementation is already running ?
"Dado" <mario_zupan@inet.hr> je napisao u poruci interesnoj
grupi:ecbkcr$i2h$1@ss408.t-com.hr...
>
> "Arne Vajhoj" <arne@vajhoej.dk> je napisao u poruci interesnoj
> grupi:fT6Gg.3850$_q4.2540@dukeread09...
>> Stepan Mozyra wrote:
>>> D> I created application which start new Server() from a code and it
>>> use
>>> D> only one database. But if I start another implementation of my
>>> D> application (it is another main method) it is not neccessary to
>>> D> create another Server but it is enough to add new database
>>> D> (database.0 ... n). How to know that one Server is already running
>>> ?
>>>
>>> Use Singleton pattern.
>>
>> To me it sounds as if the original poster is starting
>> two programs (as in different JVM's).
>>
>> Arne
>
> Yes of course, if you started application twice you got 2 different JVM.
> Is something wierd with that ? Can I use Singelton once in 2 or more
> different JVM-s ? I mean, I don't think that Singelton will know if some
> class (Server for example) is instanced once in all JVM-s.
>
Maybe I need to use Singelton to allow only one instance of my application
and change my application to allow opening more than one database ?
-
Re: HSQLDB: How to check if Server implementation is already running ?
Hello, Arne!
You wrote on Sun, 20 Aug 2006 20:12:02 -0400:
AV> To me it sounds as if the original poster is starting two programs
AV> (as in different JVM's).
Ok. I was wrong.
May be Server can opening some port, and any Application will communicate
with Server through it?
With best regards, Stepan Mozyra.
-
Re: HSQLDB: How to check if Server implementation is already running ?
"Stepan Mozyra" <gorynych@voliacable.com> je napisao u poruci interesnoj
grupi:ecg066$1qst$1@behemoth.volia.net...
> Hello, Arne!
> You wrote on Sun, 20 Aug 2006 20:12:02 -0400:
>
> AV> To me it sounds as if the original poster is starting two programs
> AV> (as in different JVM's).
>
> Ok. I was wrong.
> May be Server can opening some port, and any Application will communicate
> with Server through it?
>
>
> With best regards, Stepan Mozyra.
>
Yes, but I didn't separate Server and client but start server when my app is
starts. Now I want to open more then one database (2 or more clients app).
IMO, I can avoid starting 2 server only if I have System.exit(0) when the
user try to starts second implementation of my app. But I was interesting to
finishing my app to work in a LAN. What is a practise from a HSQLDB point of
view?
Similar Threads
-
By Application Development in forum lisp
Replies: 10
Last Post: 10-21-2007, 05:12 PM
-
By Application Development in forum JDBC JAVA
Replies: 0
Last Post: 04-18-2007, 10:11 AM
-
By Application Development in forum TCL
Replies: 1
Last Post: 04-05-2007, 08:35 AM
-
By Application Development in forum JDBC JAVA
Replies: 0
Last Post: 03-20-2007, 05:34 PM
-
By Application Development in forum Inetserver
Replies: 2
Last Post: 10-04-2004, 07:34 PM