« Return to Thread: several connections to shark

RE: Re: several connections to shark

by PedroUninova :: Rate this Message:

Reply to Author | View in Thread

Some parts of this message have been removed. Learn more about Nabble's security policy.

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 [mailto: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();

 

 



--
You receive this message as a subscriber of the shark@... mailing list.
To unsubscribe: mailto:shark-unsubscribe@...
For general help: mailto:sympa@...?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws

 « Return to Thread: several connections to shark