Hey

> Does anybody know how I can determine if my remote connection is still
> alive?

Call it and check for ConnectException.

> I am using a caching architecture for my home interfaces to avoid jndi -
> lookups, but when the connection to the server is broken I get lost. (not
in
> the factory but somewhere in user code, i.e. when the first network call
is
> made...)
>
> the schema ist something like this
>
> public class FactoryOnClientSide {
>
> protected DummyHome myDummyHome = null;
>
> public DummyHome getDummyHome() throws Exception{
> if ( myDummyHome == null)
> myDummyHome = (DummyHome)
>
PortableRemoteObject.narrow(getInitialContext().lookup("/dummies/dummy",Dumm
> yHome.class);
> else {
> // check if Remote Reference is still valid
> // else reconnect...
>
> }
> return myDummyHome;
> }
> }
>
> is there any method tho see if my peer is still alive?
> a. without making network calls ? (preferably :-))
> b. a general method for 'pinging' my peers.
> c. something less costly than calling a create and remove of a dummy
> object prior to each network call

Preemptive connection validity checking is not possible. I would recommend
using dynamic proxies and lazyloading instead. Much cleaner and simple to
implement.

/Rickard





--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to