« Return to Thread: several connections to shark
Hello again,
Searching myself for an answer the only thing found is :
Sharkconnection.disconnect();
Only this is required?
Regards,
Pedro
Hi,
Your answer did remind me of something that I have read long
time ago (I think was also one of your answers to other list member)… and
that was forgotten.
Many thanks, for your quick answer.
So I’m using shark as a library, how can I terminate shark
correctly?
Thanks one more time.
Regards,
Pedro
De: Sasa Bojanic [mailto:sasaboy@...]
Enviada: sexta-feira, 22 de Maio de 2009 8:10
Para: shark@...
Assunto: [shark] Re: RE: Re: several connections to shark
Hi,
shark can be embedded into your Java application in which case it is not a
server, it is used directly as a library.
Shark project also comes with several "server" deployments: it can be
deployed as CORBA service, Web service or EJB service.
So you can write your (separate) application to access shark and to make
connections to it.
Regards,
Sasa.
PedroUninova wrote:
Hello,
The example that you gave, allows to make several connections
inside the same java program right?
It’s is possible to have the server running independently
in one java “program” and my program (running separately)
just makes a connection to the server??
Regards and thanks,
Pedro
De: Sasa Bojanic [sasaboy@...]
Enviada: quarta-feira, 20 de Maio de 2009 13:11
Para: shark@...
Assunto: [shark] Re: several connections to shark
Hi,
this is fairly simple, e.g. to establish 2 connections:
wmci
= new WMConnectInfo("test","","","");
sharkc = Shark.getInstance().getSharkConnection();
sharkc.connect(wmci);
sh = sharkc.getSessionHandle();
wmci2
= new WMConnectInfo("secondtest","","","");
sharkc2 = Shark.getInstance().getSharkConnection();
sharkc2.connect(wmci2);
sh2 = sharkc2.getSessionHandle();
Regards,
Sasa.
PedroUninova wrote:
Hello again,
I’m now facing a different situation.
In the papers that I have read about OMG and WFMC its possible
to have several connections to shark.
Currently I can only establish one, with the code transcribed
above.
What I would like to do:
Start shark from simple java program that does nothing else. Let’s call
it “SERVER”.
After
that, one or several, entities of my main program will establish a connection
to the “SERVER”.
Can someone help me with this subject?
Regards,
Pedro
//--------------------code------------------------
LocalContextFactory.setup("sharkdb");
ut = (UserTransaction) new
InitialContext().lookup("java:comp/UserTransaction");
ut.setTransactionTimeout(50 * 60);
ut.begin();
Shark.configure(confFilePath); //(2)starting
shark
ut.commit();
ut.begin();
WMConnectInfo
wmci = new WMConnectInfo("test","","","");
sharkc = Shark.getInstance().getSharkConnection();
sharkc.connect(wmci);
sh = sharkc.getSessionHandle();
ut.commit();
« Return to Thread: several connections to shark
| Free embeddable forum powered by Nabble | Forum Help |