[omniORB] rebinding after communication failure

Bjørn Wennberg bjornw@colargol.idb.hist.no
25 May 1999 23:50:57 +0200


Chris Hafey <chafey@prowess.com> writes:

> At 03:49 PM 5/25/99 -0400, Constantin Adam wrote:
> >Hi,
> >
> >I have the following problem:
> >
> >  - Client C binds to server S, stores the object reference to S and
> >    uses it to invoke operations on S later.
> >
> >  - C invokes an operation on S.  
> >
> >  - S fails, and it is being restarted.  
> >
> >  - C tries to invoke an operation on S using the old object
> >    reference.  It fails, even though the server is alive.
> >
> >
> >One solution to this problem is to catch COMM_FAILURE exception and
> >rebind to the server. 
> >
> >Is there a better way to handle this situation, an automatic way to
> >deal with it?
> 
> You can have S rebind to the same port/object key each time.  See omnin=
ames
> for an example of how to do this.  If this isn't acceptable, I think yo=
u
> will have to catch COMM_FAILURE exceptions and rebind.  It sure would b=
e
> nice to have a virtual function _rebind() that you could override to re=
bind
> to the server object in case COMM_FAILURE is thrown.  I suppose you cou=
ld
> add this kind of feature since you have the source.
> 

If I were you I would make a templatized proxy-class that takes the
actual object as template-argument and overide the () and the -> operator. 
This proxy-class would catch all orb-exceptions and rebind on error. 

bjornw>

-- 
-------------------------------------------------------
Bjørn Wennberg       email: bjornw@colargol.idb.hist.no 
                        ms: +47 959 92 657