Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [CDO/NET4J][0.8.0] Failover mechanism
[CDO/NET4J][0.8.0] Failover mechanism [message #94261] Sun, 26 August 2007 23:33 Go to next message
Simon Mc Duff is currently offline Simon Mc DuffFriend
Messages: 596
Registered: July 2009
Senior Member
I`m interested in a failover strategy for CDO/NET4J.

Basically we have many CDOServer. If one of them fail, I would like to
redirect clients connected to the failed CDO server
to another one and continue like nothing happened.

Let me know if you have or interested in such mechanism.
Re: [CDO/NET4J][0.8.0] Failover mechanism [message #94267 is a reply to message #94261] Mon, 27 August 2007 14:55 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: stepper.sympedia.de

Simon,

That's of course also an interesting feature. You should add a feature
request for it.
But, to be honest, I don't believe that I'm able to implement it in the
very near future because there are many other things that will take time.

If you have an idea how to implement this feature or even have a patch
I'd appreciate to discuss/review it with you ;-)

Cheers
/Eike



Simon McDuff schrieb:
> I`m interested in a failover strategy for CDO/NET4J.
>
> Basically we have many CDOServer. If one of them fail, I would like to
> redirect clients connected to the failed CDO server
> to another one and continue like nothing happened.
>
> Let me know if you have or interested in such mechanism.
>
>
>
>
Re: [CDO/NET4J][0.8.0] Failover mechanism [message #94271 is a reply to message #94267] Mon, 27 August 2007 15:00 Go to previous messageGo to next message
Simon Mc Duff is currently offline Simon Mc DuffFriend
Messages: 596
Registered: July 2009
Senior Member
https://bugs.eclipse.org/bugs/show_bug.cgi?id=201267



"Eike Stepper" <stepper@sympedia.de> wrote in message
news:fauokl$frt$3@build.eclipse.org...
> Simon,
>
> That's of course also an interesting feature. You should add a feature
> request for it.
> But, to be honest, I don't believe that I'm able to implement it in the
> very near future because there are many other things that will take time.
>
> If you have an idea how to implement this feature or even have a patch I'd
> appreciate to discuss/review it with you ;-)
>
> Cheers
> /Eike
>
>
>
> Simon McDuff schrieb:
>> I`m interested in a failover strategy for CDO/NET4J.
>>
>> Basically we have many CDOServer. If one of them fail, I would like to
>> redirect clients connected to the failed CDO server
>> to another one and continue like nothing happened.
>>
>> Let me know if you have or interested in such mechanism.
>>
>>
>>
>>
Re: [CDO/NET4J][0.8.0] Failover mechanism [message #94276 is a reply to message #94267] Tue, 28 August 2007 01:58 Go to previous messageGo to next message
Simon Mc Duff is currently offline Simon Mc DuffFriend
Messages: 596
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.

------=_NextPart_000_01F6_01C7E8F5.571D5480
Content-Type: text/plain;
charset="ISO-8859-15"
Content-Transfer-Encoding: quoted-printable

What do you think of the following :

CDOSessionImpl could have a failOverStrategy. It just need to be notify =
when this happen.
We will need to wrap every request like the following

=20
return new FailOverRequest<CDORevisionImpl>(session)
{
public CDORevisionImpl sendRequest(int timeout) throws =
TimeoutException, Exception
{
// Previous code
return new LoadRevisionRequest(session.getChannel(), =
id).send(timeout);
}
}.send(1000);


FailOverRequest.java

public abstract class FailOverRequest<REQUEST>
{
CDOSessionImpl session;
public FailOverRequest(CDOSessionImpl session)
{
this.session =3D session;
}

public REQUEST send(int timeout) throws Exception
{
TimeoutException timeOutException =3D null;
FailOverStrategy failOverStrategy =3D null;
do
{
try
{
return sendRequest(timeout);
}
catch(TimeoutException exeption)
{
// Could use IManageContainer to get the strategy
if (failOverStrategy !=3D null)
failOverStrategy =3D =
FailOverStrategyFactory.create(repositoryName);

IConnector connector =3D =
failOverStrategy.requestNewConnector(session);

if (connector =3D=3D null)
throw exeption;

session.replaceConnector(connector);=20
}
} while (true);
}

public abstract REQUEST sendRequest(int timeout) throws =
TimeoutException, Exception;

}


I tried it with 2 servers... and it worked well when I load objects !!!

CDOSessionImpl.replaceConnector have the following: (maybe I need more =
things...I`m not sure )


EventUtil.removeListener(channel, channelListener);

setConnector(connectr);

OpenSessionRequest request =3D new OpenSessionRequest(channel, =
repositoryName);
OpenSessionResult result =3D request.send();
sessionID =3D result.getSessionID();
repositoryUUID =3D result.getRepositoryUUID();



I wasn`t sure if you would like to put the fail-over closer to net4j or =
not..=20

Let me know what you think.


"Eike Stepper" <stepper@sympedia.de> a =E9crit dans le message de news: =
fauokl$frt$3@build.eclipse.org...
> Simon,
>=20
> That's of course also an interesting feature. You should add a feature =

> request for it.
> But, to be honest, I don't believe that I'm able to implement it in =
the=20
> very near future because there are many other things that will take =
time.
>=20
> If you have an idea how to implement this feature or even have a patch =

> I'd appreciate to discuss/review it with you ;-)
>=20
> Cheers
> /Eike
>=20
>=20
>=20
> Simon McDuff schrieb:
>> I`m interested in a failover strategy for CDO/NET4J.
>>
>> Basically we have many CDOServer. If one of them fail, I would like =
to=20
>> redirect clients connected to the failed CDO server
>> to another one and continue like nothing happened.
>>
>> Let me know if you have or interested in such mechanism.
>>
>>
>>
>>
------=_NextPart_000_01F6_01C7E8F5.571D5480
Content-Type: text/html;
charset="ISO-8859-15"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-15">
<META content=3D"MSHTML 6.00.6000.16525" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>What do you think of the following =
:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>CDOSessionImpl could have a =
failOverStrategy. It=20
just need to be notify when this happen.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>We will need to wrap every request like =
the=20
following</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; </FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>return new=20
FailOverRequest&lt;CDORevisionImpl&gt;(session)</FONT ></DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>{</FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; public=20
CDORevisionImpl sendRequest(int timeout) throws TimeoutException,=20
Exception</FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
{</FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp; //=20
Previous code</FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
<STRONG>return new LoadRevisionRequest(session.getChannel(),=20
id).send(timeout);</STRONG></FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
}</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>}.send(1000);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial =
size=3D2><STRONG>FailOverRequest.java</STRONG></FONT></DIV >
<DIV><STRONG><FONT face=3DArial =
size=3D2></FONT></STRONG>&nbsp;</DIV><FONT=20
face=3DArial size=3D2><FONT color=3D#7f0055 size=3D2>
<DIV align=3Dleft><FONT color=3D#000000>public</FONT></FONT><FONT =
size=3D2>=20
</FONT><FONT size=3D2>abstract</FONT><FONT size=3D2> </FONT><FONT=20
size=3D2>class</FONT><FONT size=3D2> =
FailOverRequest&lt;REQUEST&gt;</DIV>
<DIV align=3Dleft>{</DIV>
<DIV align=3Dleft>CDOSessionImpl </FONT><FONT color=3D#0000c0=20
size=3D2>session</FONT><FONT size=3D2>;</DIV>
<DIV align=3Dleft></FONT><B><FONT color=3D#7f0055 =
size=3D2>public</B></FONT><FONT=20
size=3D2> FailOverRequest(CDOSessionImpl session)</DIV>
<DIV align=3Dleft>{</DIV>
<DIV align=3Dleft></FONT><B><FONT color=3D#7f0055 =
size=3D2>&nbsp;&nbsp;&nbsp;=20
this</B></FONT><FONT size=3D2>.</FONT><FONT color=3D#0000c0=20
size=3D2>session</FONT><FONT size=3D2> =3D session;</DIV>
<DIV align=3Dleft>}</DIV>
<DIV align=3Dleft>&nbsp;</DIV>
<DIV align=3Dleft></FONT><B><FONT color=3D#7f0055 =
size=3D2>public</B></FONT><FONT=20
size=3D2> REQUEST send(</FONT><B><FONT color=3D#7f0055 =
size=3D2>int</B></FONT><FONT=20
size=3D2> timeout) </FONT><B><FONT color=3D#7f0055 =
size=3D2>throws</B></FONT><FONT=20
size=3D2> Exception</DIV>
<DIV align=3Dleft>{</DIV>
<DIV align=3Dleft>&nbsp;&nbsp;&nbsp; TimeoutException timeOutException =
=3D=20
</FONT><B><FONT color=3D#7f0055 size=3D2>null</B></FONT><FONT =
size=3D2>;</FONT></DIV>
<DIV align=3Dleft><FONT size=3D2>&nbsp;&nbsp;&nbsp; FailOverStrategy=20
failOverStrategy =3D null;</DIV>
<DIV align=3Dleft></FONT><B><FONT color=3D#7f0055 =
size=3D2>&nbsp;&nbsp;&nbsp;=20
do</DIV></B></FONT><FONT size=3D2>
<DIV align=3Dleft>&nbsp;&nbsp;&nbsp; {</DIV>
<DIV align=3Dleft></FONT><B><FONT color=3D#7f0055 =
size=3D2>&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; try</DIV></B></FONT><FONT size=3D2>
<DIV align=3Dleft> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</DIV>
<DIV align=3Dleft></FONT><B><FONT color=3D#7f0055 =
size=3D2>&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; return</B></FONT><FONT size=3D2>=20
sendRequest(timeout);</DIV>
<DIV align=3Dleft>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</DIV>
<DIV align=3Dleft></FONT><B><FONT color=3D#7f0055 =
size=3D2>&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; catch</B></FONT><FONT size=3D2>(TimeoutException=20
exeption)</DIV>
<DIV align=3Dleft>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</DIV>
<DIV align=3Dleft><FONT=20
size=3D2> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p; //=20
Could use IManageContainer to get the strategy</FONT></DIV>
<DIV align=3Dleft>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp; if=20
(failOverStrategy&nbsp; !=3D null)</DIV>
<DIV align=3Dleft>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; failOverStrategy =3D=20
FailOverStrategyFactory.create(<FONT color=3D#0000c0 size=3D2><FONT=20
color=3D#000000>repositoryName</FONT></FONT>);</DIV>
<DIV align=3Dleft>&nbsp;</DIV>
<DIV=20
align=3Dleft> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;IConnector=20
connector =3D failOverStrategy.requestNewConnector(<FONT color=3D#0000c0 =

size=3D2>session</FONT><FONT size=3D2>);</FONT></DIV>
<DIV align=3Dleft>&nbsp;</DIV></FONT><FONT size=3D2>
<DIV align=3Dleft></FONT><B><FONT color=3D#7f0055=20
size=3D2> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;if</B></FONT><FONT=20
size=3D2> (connector =3D=3D </FONT><B><FONT color=3D#7f0055 =
size=3D2>null</B></FONT><FONT=20
size=3D2>)</DIV>
<DIV align=3Dleft></FONT><B><FONT color=3D#7f0055 =
size=3D2>&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; throw</B></FONT><FONT size=3D2> =
exeption;</FONT></DIV>
<DIV align=3Dleft><FONT size=3D2>&nbsp;</DIV>
<DIV align=3Dleft></FONT><FONT color=3D#0000c0 =
size=3D2>&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; session</FONT><FONT=20
size=3D2>.replaceConnector(connector); </DIV>
<DIV =
align=3Dleft> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;} </DIV>
<DIV align=3Dleft>&nbsp;&nbsp;&nbsp; } </FONT><B><FONT color=3D#7f0055=20
size=3D2>while</B></FONT><FONT size=3D2> (</FONT><B><FONT =
color=3D#7f0055=20
size=3D2>true</B></FONT><FONT size=3D2>);</DIV>
<DIV align=3Dleft>}</DIV>
<DIV align=3Dleft></FONT><B><FONT color=3D#7f0055 =
size=3D2></FONT></B>&nbsp;</DIV>
<DIV align=3Dleft><B><FONT color=3D#7f0055 =
size=3D2>public</B></FONT><FONT size=3D2>=20
</FONT><B><FONT color=3D#7f0055 size=3D2>abstract</B></FONT><FONT =
size=3D2> REQUEST=20
sendRequest(</FONT><B><FONT color=3D#7f0055 size=3D2>int</B></FONT><FONT =
size=3D2>=20
timeout) </FONT><B><FONT color=3D#7f0055 size=3D2>throws</B></FONT><FONT =
size=3D2>=20
TimeoutException, Exception;</DIV>
<DIV>&nbsp;</DIV>
<DIV>}</DIV></FONT></FONT>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I tried it with 2 servers... and it =
worked well=20
when I load objects !!!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>CDOSessionImpl.replaceConnector have =
the following:=20
(maybe I need more things...I`m not sure )</FONT></DIV><FONT size=3D2>
<DIV align=3Dleft><FONT face=3DArial></FONT>&nbsp;</DIV>
<DIV align=3Dleft><FONT face=3DArial></FONT>&nbsp;</DIV>
<DIV align=3Dleft><FONT=20
face=3DArial>EventUtil.<I>removeListener</I>(</FONT></FONT ><FONT =
face=3DArial><FONT=20
color=3D#0000c0 size=3D2>channel</FONT><FONT size=3D2>, </FONT><FONT =
color=3D#0000c0=20
size=3D2>channelListener</FONT></FONT><FONT size=3D2><FONT=20
face=3DArial>);</FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial></FONT>&nbsp;</DIV>
<DIV align=3Dleft><FONT =
face=3DArial>setConnector(connectr);</FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial></FONT>&nbsp;</DIV>
<DIV align=3Dleft><FONT face=3DArial>OpenSessionRequest request =3D=20
</FONT></FONT><B><FONT color=3D#7f0055 size=3D2><FONT=20
face=3DArial>new</FONT></B></FONT><FONT face=3DArial><FONT size=3D2>=20
OpenSessionRequest(</FONT><FONT color=3D#0000c0 =
size=3D2>channel</FONT><FONT=20
size=3D2>, </FONT><FONT color=3D#0000c0 =
size=3D2>repositoryName</FONT></FONT><FONT=20
size=3D2><FONT face=3DArial>);</FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial>OpenSessionResult result =3D=20
request.send();</FONT></DIV>
<DIV align=3Dleft></FONT><FONT face=3DArial color=3D#0000c0=20
size=3D2>sessionID</FONT><FONT size=3D2><FONT face=3DArial> =3D=20
result.getSessionID();</FONT></DIV>
<DIV align=3Dleft></FONT><FONT face=3DArial><FONT color=3D#0000c0=20
size=3D2>repositoryUUID</FONT><FONT size=3D2> =3D=20
result.getRepositoryUUID();</DIV></FONT></FONT>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I wasn`t sure if you would like to put =
the=20
fail-over closer to net4j or not..&nbsp;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Let me know what you =
think.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT><FONT face=3DArial =
size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>"Eike Stepper" &lt;</FONT><A=20
href=3D"mailto:stepper@sympedia.de"><FONT face=3DArial=20
size=3D2>stepper@sympedia.de</FONT></A><FONT face=3DArial size=3D2>&gt; =
a =E9crit dans=20
le message de news: </FONT><A =
href=3D"mailto:fauokl$frt$3@build.eclipse.org"><FONT=20
face=3DArial size=3D2>fauokl$frt$3@build.eclipse.org</FONT></A><FONT =
face=3DArial=20
size=3D2>...</FONT></DIV><FONT face=3DArial size=3D2>&gt; Simon,<BR>&gt; =
<BR>&gt;=20
That's of course also an interesting feature. You should add a feature =
<BR>&gt;=20
request for it.<BR>&gt; But, to be honest, I don't believe that I'm able =
to=20
implement it in the <BR>&gt; very near future because there are many =
other=20
things that will take time.<BR>&gt; <BR>&gt; If you have an idea how to=20
implement this feature or even have a patch <BR>&gt; I'd appreciate to=20
discuss/review it with you ;-)<BR>&gt; <BR>&gt; Cheers<BR>&gt; =
/Eike<BR>&gt;=20
<BR>&gt; <BR>&gt; <BR>&gt; Simon McDuff schrieb:<BR>&gt;&gt; I`m =
interested in a=20
failover strategy for CDO/NET4J.<BR>&gt;&gt;<BR>&gt;&gt; Basically we =
have many=20
CDOServer. If one of them fail, I would like to <BR>&gt;&gt; redirect =
clients=20
connected to the failed CDO server<BR>&gt;&gt; to another one and =
continue like=20
nothing happened.<BR>&gt;&gt;<BR>&gt;&gt; Let me know if you have or =
interested=20
in such=20
mechanism.<BR>&gt;&gt;<BR>&gt;&gt;<BR>&gt;&gt; <BR>&gt;&gt;</FONT></BODY><=
/HTML>

------=_NextPart_000_01F6_01C7E8F5.571D5480--
Re: [CDO/NET4J][0.8.0] Failover mechanism [message #94355 is a reply to message #94276] Tue, 28 August 2007 05:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: stepper.sympedia.de

This is a multi-part message in MIME format.
--------------040207090000070602060408
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Simon McDuff schrieb:
> What do you think of the following :
>
> CDOSessionImpl could have a failOverStrategy. It just need to be
> notify when this happen.
> We will need to wrap every request like the following
>
>
> return new FailOverRequest<CDORevisionImpl>(session)
> {
> public CDORevisionImpl sendRequest(int timeout) throws
> TimeoutException, Exception
> {
> // Previous code
> *return new LoadRevisionRequest(session.getChannel(),
> id).send(timeout);*
> }
> }.send(1000);
>
>
> *FailOverRequest.java*
> **
> public abstract class FailOverRequest<REQUEST>
> {
> CDOSessionImpl session;
> *public* FailOverRequest(CDOSessionImpl session)
> {
> * this*.session = session;
> }
>
> *public* REQUEST send(*int* timeout) *throws* Exception
> {
> TimeoutException timeOutException = *null*;
> FailOverStrategy failOverStrategy = null;
> * do*
> {
> * try*
> {
> * return* sendRequest(timeout);
> }
> * catch*(TimeoutException exeption)
> {
> // Could use IManageContainer to get the strategy
> if (failOverStrategy != null)
> failOverStrategy =
> FailOverStrategyFactory.create(repositoryName);
>
> IConnector connector =
> failOverStrategy.requestNewConnector(session);
>
> * if* (connector == *null*)
> * throw* exeption;
>
> session.replaceConnector(connector);
> }
> } *while* (*true*);
> }
>
> *public* *abstract* REQUEST sendRequest(*int* timeout) *throws*
> TimeoutException, Exception;
>
> }
>
>
> I tried it with 2 servers... and it worked well when I load objects !!!
It is an interesting idea to wrap the requests!
Maybe it'd even be better if it was not necessary to subclass
FailoverRequest for each signal to be wrapped.
I think that it could be possible to make the send() method of
SignalActor protected and have it called by a generic method of an
IFailOverStrategy:


IFailOverStrategy failOverStrategy =
cdoSession.getFailOverStrategy();
LoadRevisionRequest<CDORevisionImpl> request = new
LoadRevisionRequest(session.getChannel(), id).send(timeout);
long timeout = 2500;
CDORevisionImpl result = failOverStrategy.send(request, timeout);

The fail over strategy implementation could be dependent on CDOSession
and react for example on the deactivation of the IChannel (due to server
or network failure).
What do you think?


> CDOSessionImpl.replaceConnector have the following: (maybe I need more
> things...I`m not sure )
>
>
> EventUtil./removeListener/(channel, channelListener);
>
> setConnector(connectr);
>
> OpenSessionRequest request = *new* OpenSessionRequest(channel,
> repositoryName);
> OpenSessionResult result = request.send();
> sessionID = result.getSessionID();
> repositoryUUID = result.getRepositoryUUID();
>
>
>
> I wasn`t sure if you would like to put the fail-over closer to net4j
> or not..
If that is possible (see above) it would of course be better.

Cheers
/Eike



--------------040207090000070602060408
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Simon McDuff schrieb:
<blockquote cite="mid:favvfb$pmt$1@build.eclipse.org" type="cite">
<meta http-equiv="Content-Type" content="text/html; ">
<meta content="MSHTML 6.00.6000.16525" name="GENERATOR">
<style></style>
<div><font face="Arial" size="2">What do you think of the following :</font></div>
<div>
Re: [CDO/NET4J][0.8.0] Failover mechanism [message #94645 is a reply to message #94355] Tue, 28 August 2007 12:30 Go to previous messageGo to next message
Simon Mc Duff is currently offline Simon Mc DuffFriend
Messages: 596
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.

------=_NextPart_000_010F_01C7E94D.A486F4D0
Content-Type: text/plain;
charset="ISO-8859-15"
Content-Transfer-Encoding: quoted-printable


"Eike Stepper" <stepper@sympedia.de> wrote in message =
news:fb0bva$odv$2@build.eclipse.org...
Simon McDuff schrieb:=20
What do you think of the following :

CDOSessionImpl could have a failOverStrategy. It just need to be =
notify when this happen.
We will need to wrap every request like the following

=20
return new FailOverRequest<CDORevisionImpl>(session)
{
public CDORevisionImpl sendRequest(int timeout) throws =
TimeoutException, Exception
{
// Previous code
return new LoadRevisionRequest(session.getChannel(), =
id).send(timeout);
}
}.send(1000);


FailOverRequest.java

public class FailOverRequest<REQUEST>
{

Object session;
public FailOverRequest(SignalActor<RESULT> sending, Object session)
{
this.session =3D session;
}

public REQUEST send(int timeout) throws Exception
{
TimeoutException timeOutException =3D null;
FailOverStrategy failOverStrategy =3D null;
do
{
try
{
return signalActor.send(timeout);
}
catch(TimeoutException exeption)
{
// Could use IManageContainer to get the strategy
if (failOverStrategy !=3D null)
failOverStrategy =3D =
FailOverStrategyFactory.create(repositoryName);

IChannel channel=3D =
failOverStrategy.requestNewConnector(session);

if (channel=3D=3D null)
throw exeption;

signalActor.replaceChannel( channel );=20
}
} while (true);
}


}


I tried it with 2 servers... and it worked well when I load objects =
!!!
It is an interesting idea to wrap the requests!
[Simon] The advantage of wrapping it is the following. If the session =
change channel(between the first and second request)... it will change =
as well.

Maybe it'd even be better if it was not necessary to subclass =
FailoverRequest for each signal to be wrapped.[Agree.. but we will need =
to modify deeper]
I think that it could be possible to make the send() method of =
SignalActor protected and have it called by a generic method of an =
IFailOverStrategy..
[I don't understand . It is how it is designed ?=20
Do you will subclass Signal<Actor> ?? Or SignalActor will know about =
failoverstrategy...]
Or Signal<Actor> implements IFailOverStrategy ??


IFailOverStrategy failOverStrategy =3D =
cdoSession.getFailOverStrategy();
LoadRevisionRequest<CDORevisionImpl> request =3D new =
LoadRevisionRequest(session.getChannel(), id).send(timeout);
long timeout =3D 2500;
CDORevisionImpl result =3D failOverStrategy.send(request, =
timeout);

The fail over strategy implementation could be dependent on CDOSession =
and react for example on the deactivation of the IChannel (due to server =
or network failure).
What do you think?
[Simon] FailOverStrategy will ask for another channel... and the =
Signal<Actor> will change it. Signal<Actor> need to be able to change =
channel right ?
[Simon] React on a desactivation of a IChannel... yes but it will need =
to differentiate between when I close the connection and when the =
network has errors. Also CDOSession should not fireEvent based on a =
fail-over... since the lifecycle of CDOSession is not desactivate. Right =
?
Maybe we should react on another event ... like TimeOutEvent...=20







SignalActor=20



CDOSessionImpl.replaceConnector have the following: (maybe I need =
more things...I`m not sure )


EventUtil.removeListener(channel, channelListener);

setConnector(connectr);

OpenSessionRequest request =3D new OpenSessionRequest(channel, =
repositoryName);
OpenSessionResult result =3D request.send();
sessionID =3D result.getSessionID();
repositoryUUID =3D result.getRepositoryUUID();



I wasn`t sure if you would like to put the fail-over closer to net4j =
or not..=20

If that is possible (see above) it would of course be better.

Cheers
/Eike



------=_NextPart_000_010F_01C7E94D.A486F4D0
Content-Type: text/html;
charset="ISO-8859-15"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type =
content=3Dtext/html;charset=3DISO-8859-15>
<META content=3D"MSHTML 6.00.2900.3157" name=3DGENERATOR></HEAD>
<BODY text=3D#000000 bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Eike Stepper" &lt;<A=20
href=3D"mailto:stepper@sympedia.de">stepper@sympedia.de</A>&gt; wrote =
in message=20
<A=20
=
href=3D"news:fb0bva$odv$2@build.eclipse.org">news:fb0bva$odv$2@build.ecli=
pse.org</A>...</DIV>Simon=20
McDuff schrieb:=20
<BLOCKQUOTE cite=3Dmid:favvfb$pmt$1@build.eclipse.org type=3D"cite">
<META content=3D"MSHTML 6.00.6000.16525" name=3DGENERATOR>
<STYLE></STYLE>

<DIV><FONT face=3DArial size=3D2>What do you think of the following=20
:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>CDOSessionImpl could have a =
failOverStrategy.=20
It just need to be notify when this happen.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>We will need to wrap every request =
like the=20
following</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; </FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>return new=20
FailOverRequest&lt;CDORevisionImpl&gt;(session)</FONT ></DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>{</FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
public=20
CDORevisionImpl sendRequest(int timeout) throws TimeoutException,=20
Exception</FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
{</FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; // Previous code</FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; <STRONG>return new=20
LoadRevisionRequest(session.getChannel(),=20
id).send(timeout);</STRONG></FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
}</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>}.send(1000);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial=20
size=3D2><STRONG>FailOverRequest.java</STRONG></FONT></DIV >
<DIV><STRONG></STRONG>&nbsp;</DIV><FONT face=3DArial size=3D2><FONT=20
color=3D#7f0055 size=3D2></FONT>
<DIV align=3Dleft><FONT color=3D#7f0055 size=3D2><FONT=20
color=3D#000000>public</FONT></FONT><FONT =
size=3D2>&nbsp;</FONT><FONT=20
size=3D2>class</FONT><FONT size=3D2> =
FailOverRequest&lt;REQUEST&gt;</FONT></DIV>
<DIV align=3Dleft><FONT size=3D2>{</FONT></DIV>
<DIV align=3Dleft><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV align=3Dleft><FONT size=3D2><FONT=20
color=3D#0000c0>Object</FONT>&nbsp;</FONT><FONT color=3D#0000c0=20
size=3D2>session</FONT><FONT size=3D2>;</FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><B><FONT color=3D#7f0055=20
size=3D2>public</FONT></B><FONT size=3D2>=20
FailOverRequest(SignalActor&lt;RESULT&gt; sending, Object=20
session)</FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT =
size=3D2>{</FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><B><FONT =
color=3D#7f0055=20
size=3D2>&nbsp;&nbsp;&nbsp; this</FONT></B><FONT =
size=3D2>.</FONT><FONT=20
color=3D#0000c0 size=3D2>session</FONT><FONT size=3D2> =3D=20
session;</FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT=20
size=3D2>}</FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT=20
size=3D2></FONT></FONT></FONT>&nbsp;</DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><B><FONT=20
color=3D#7f0055 size=3D2>public</FONT></B><FONT size=3D2> REQUEST=20
send(</FONT><B><FONT color=3D#7f0055 size=3D2>int</FONT></B><FONT =
size=3D2>=20
timeout) </FONT><B><FONT color=3D#7f0055 =
size=3D2>throws</FONT></B><FONT size=3D2>=20
Exception</FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =

size=3D2>{</FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =

size=3D2>&nbsp;&nbsp;&nbsp; TimeoutException timeOutException =3D=20
</FONT><B><FONT color=3D#7f0055 size=3D2>null</FONT></B><FONT=20
size=3D2>;</FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =

size=3D2>&nbsp;&nbsp;&nbsp; FailOverStrategy failOverStrategy =3D=20
null;</FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><B><FONT=20
color=3D#7f0055 size=3D2>&nbsp;&nbsp;&nbsp;=20
do</FONT></B></FONT></FONT></FONT></FONT></DIV><FONT size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT=20
size=3D2></FONT></FONT></FONT></FONT></FONT>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2>&nbsp;&nbsp;&nbsp; =
{</FONT></FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><B><FONT color=3D#7f0055 size=3D2>&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
try</FONT></B></FONT></FONT></FONT></FONT></FONT></DIV ><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT=20
size=3D2></FONT></FONT></FONT></FONT></FONT></FONT>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =20
{</FONT></FONT></FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><B><FONT color=3D#7f0055 =
size=3D2>&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; return</FONT></B><FONT =
size=3D2>=20
=
signalActor.send(timeout);</FONT></FONT></FONT></FONT></FONT ></FONT></FON=
T></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2>&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
}</FONT></FONT></FONT></FONT></FONT></FONT></FONT></DIV >
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><B><FONT color=3D#7f0055=20
size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; catch</FONT></B><FONT =

size=3D2>(TimeoutException=20
=
exeption)</FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2>&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp;=20
{</FONT></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT=20
=
size=3D2> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p; //=20
Could use IManageContainer to get the=20
=
strategy</FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT></=
DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2>&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (failOverStrategy&nbsp; =
!=3D=20
null)</FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2>&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
failOverStrategy =3D FailOverStrategyFactory.create(<FONT =
color=3D#0000c0=20
size=3D2><FONT=20
=
color=3D#000000>repositoryName</FONT></FONT>);</FONT></FONT ></FONT></FONT=
></FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT=20
=
size=3D2></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT>&nbsp;</=
DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT=20
=
size=3D2> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;IChannel=20
channel=3D failOverStrategy.requestNewConnector(<FONT=20
size=3D2>session</FONT><FONT=20
=
size=3D2>);</FONT></FONT></FONT></FONT></FONT></FONT> </FONT></FONT></FONT=
></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT=20
=
size=3D2></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT>&nbsp;</=
DIV><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT=20
size=3D2></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><B><FONT =
color=3D#7f0055=20
=
size=3D2> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;if</FONT></B><FONT=20
size=3D2> (channel=3D=3D </FONT><B><FONT color=3D#7f0055 =
size=3D2>null</FONT></B><FONT=20
=
size=3D2>)</FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT>=
</DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><B><FONT=20
color=3D#7f0055 size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
throw</FONT></B><FONT size=3D2>=20
=
exeption;</FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT><=
/FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
=
size=3D2></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT><=
/FONT>&nbsp;</DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT color=3D#0000c0=20
=
size=3D2> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;=20
<FONT color=3D#000000>signalActor.</FONT></FONT><FONT =
size=3D2>replaceChannel(=20
channel );=20
=
</FONT></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT></F=
ONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT=20
=
size=3D2> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;} </FONT></FONT><=
/FONT></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2>&nbsp;&nbsp;&nbsp; } </FONT><B><FONT =
color=3D#7f0055=20
size=3D2>while</FONT></B><FONT size=3D2> (</FONT><B><FONT =
color=3D#7f0055=20
size=3D2>true</FONT></B><FONT=20
=
size=3D2>);</FONT></FONT></FONT></FONT></FONT></FONT> </FONT></FONT></FONT=
></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT=20
=
size=3D2>}</FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT>=
</FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT=20
=
size=3D2></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT><=
/FONT></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT=20
=
size=3D2></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT><=
/FONT></FONT></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT=20
=
size=3D2>}</FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT>=
</FONT></FONT></FONT></DIV><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT=20
=
size=3D2></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT><=
/FONT>
<DIV><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT=20
=
size=3D2></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT><=
/FONT>&nbsp;</DIV>
<DIV><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT=20
=
size=3D2></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT><=
/FONT>&nbsp;</DIV>
<DIV><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT face=3DArial=20
size=3D2>I tried it with 2 servers... and it worked well when I load =
objects=20
=
!!!</FONT></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT>=
</FONT></DIV></FONT></BLOCKQUOTE>
<DIV>It is an interesting idea to wrap the requests!</DIV>
<DIV><FONT face=3DArial size=3D2><STRONG>[Simon] The advantage of =
wrapping=20
it&nbsp;is the following. If the session change channel(between the =
first and=20
second request)... it will change as =
well.</STRONG></FONT></DIV><STRONG><FONT=20
face=3DArial size=3D2></FONT></STRONG></BLOCKQUOTE>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV><FONT face=3DArial size=3D2></FONT><FONT face=3DArial =
size=3D2></FONT><FONT=20
face=3DArial size=3D2></FONT><BR>Maybe it'd even be better if it was =
not necessary=20
to subclass FailoverRequest for each signal to be =
wrapped.<STRONG>[Agree.. but=20
we will need to modify deeper]</STRONG><BR>I think that it could be =
possible=20
to make the send() method of SignalActor protected and have it called =
by a=20
generic method of an IFailOverStrategy..</DIV>
<DIV><FONT face=3DArial size=3D2><STRONG>[I don't understand&nbsp;. It =
is how it=20
is designed ?&nbsp;</STRONG></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><STRONG>Do you will subclass =
Signal&lt;Actor&gt;=20
?? Or SignalActor will know=20
about&nbsp;failoverstrategy...]</STRONG></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Or <STRONG>Signal&lt;Actor&gt;&nbsp; =
implements=20
IFailOverStrategy ??</STRONG></FONT></DIV>
<DIV><STRONG><FONT face=3DArial size=3D2></FONT></STRONG><FONT=20
size=3D2><BR></FONT><FONT face=3DArial><BR><FONT=20
size=3D2> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; IFailOverStrategy=20
failOverStrategy =3D cdoSession.getFailOverStrategy();<BR>&nbsp;&nbsp; =

&nbsp;&nbsp;&nbsp;&nbsp; LoadRevisionRequest&lt;CDORevisionImpl&gt; =
request =3D=20
new LoadRevisionRequest(session.getChannel(),=20
id).send(timeout);<BR>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; long =
timeout =3D=20
2500;<BR>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; CDORevisionImpl&nbsp; =
result =3D=20
failOverStrategy.send(request, timeout);<BR></FONT></FONT><BR>The fail =
over=20
strategy implementation could be dependent on CDOSession and react for =
example=20
on the deactivation of the IChannel (due to server or network=20
failure).<BR>What do you think?<BR><FONT size=3D2><FONT=20
face=3DArial><STRONG>[Simon] FailOverStrategy will ask for another =
channel...=20
and the Signal&lt;Actor&gt; will change it. Signal&lt;Actor&gt; need =
to be=20
able to change channel right =
?</STRONG></FONT></FONT></DIV></BLOCKQUOTE>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV><STRONG><FONT face=3DArial size=3D2>[Simon] React on a =
desactivation of a=20
IChannel... yes but it will need to differentiate between when I close =
the=20
connection and when the network has errors.&nbsp; Also CDOSession =
should not=20
fireEvent based on a fail-over... since the lifecycle of CDOSession is =
not=20
desactivate. Right ?</FONT></STRONG></DIV>
<DIV><STRONG><FONT face=3DArial size=3D2>Maybe we should react on =
another event=20
... like TimeOutEvent... </FONT></STRONG></DIV>
<DIV><STRONG><FONT face=3DArial size=3D2></FONT></STRONG>&nbsp;</DIV>
<DIV><STRONG><FONT face=3DArial size=3D2></FONT></STRONG>&nbsp;</DIV>
<DIV><STRONG><FONT face=3DArial size=3D2></FONT></STRONG>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>SignalActor </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<BLOCKQUOTE cite=3Dmid:favvfb$pmt$1@build.eclipse.org =
type=3D"cite"><FONT=20
face=3DArial size=3D2>
<DIV><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT face=3DArial=20
size=3D2>CDOSessionImpl.replaceConnector have the following: (maybe =
I need=20
more things...I`m not sure=20
=
)</FONT></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT></=
FONT></DIV><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
=
size=3D2></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT><=
/FONT></FONT>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT=20
=
size=3D2></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT><=
/FONT></FONT>&nbsp;</DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT=20
=
size=3D2></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT><=
/FONT></FONT>&nbsp;</DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT=20
face=3DArial>EventUtil.<I>removeListener</I>(</FONT></FONT ><FONT=20
face=3DArial><FONT color=3D#0000c0 size=3D2>channel</FONT><FONT =
size=3D2>,=20
</FONT><FONT color=3D#0000c0 =
size=3D2>channelListener</FONT></FONT><FONT=20
size=3D2><FONT=20
=
face=3DArial>);</FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT></=
FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT=20
=
size=3D2></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT><=
/FONT></FONT>&nbsp;</DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT=20
=
face=3DArial>setConnector(connectr);</FONT></FONT></FONT ></FONT></FONT></=
FONT></FONT></FONT></FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT=20
=
size=3D2></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT><=
/FONT></FONT>&nbsp;</DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT face=3DArial>OpenSessionRequest =
request =3D=20
</FONT></FONT><B><FONT color=3D#7f0055 size=3D2><FONT=20
face=3DArial>new</FONT></FONT></B><FONT face=3DArial><FONT size=3D2> =

OpenSessionRequest(</FONT><FONT color=3D#0000c0 =
size=3D2>channel</FONT><FONT=20
size=3D2>, </FONT><FONT color=3D#0000c0 =
size=3D2>repositoryName</FONT></FONT><FONT=20
size=3D2><FONT=20
=
face=3DArial>);</FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT></=
FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT face=3DArial>OpenSessionResult result =
=3D=20
=
request.send();</FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT></=
FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT face=3DArial color=3D#0000c0=20
size=3D2>sessionID</FONT><FONT size=3D2><FONT face=3DArial> =3D=20
=
result.getSessionID();</FONT></FONT></FONT></FONT></FONT ></FONT></FONT></=
FONT></FONT></FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT face=3DArial><FONT =
color=3D#0000c0=20
size=3D2>repositoryUUID</FONT><FONT size=3D2> =3D=20
=
result.getRepositoryUUID();</FONT></FONT></FONT></FONT></FONT ></FONT></FO=
NT></FONT></FONT></FONT></FONT></FONT></FONT></FONT></DIV ><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT=20
=
size=3D2></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT><=
/FONT></FONT></FONT>
<DIV><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT=20
=
size=3D2></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT><=
/FONT></FONT></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT=20
=
size=3D2></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT><=
/FONT></FONT></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT=20
=
size=3D2></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT><=
/FONT></FONT></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT face=3DArial size=3D2>I wasn`t sure if =
you would like=20
to put the fail-over closer to net4j or not..=20
=
<BR></FONT></FONT></FONT></FONT></FONT></FONT></FONT> </FONT></FONT></FONT=
></FONT></FONT></FONT></DIV></FONT></BLOCKQUOTE>If=20
that is possible (see above) it would of course be=20
better.<BR><BR>Cheers<BR>/Eike<BR><BR><BR></BLOCKQUOTE ></BODY></HTML>

------=_NextPart_000_010F_01C7E94D.A486F4D0--
Re: [CDO/NET4J][0.8.0] Failover mechanism [message #94723 is a reply to message #94645] Tue, 28 August 2007 19:54 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: stepper.sympedia.de

This is a multi-part message in MIME format.
--------------020109070407060707000404
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Simon McDuff schrieb:
>
>
> "Eike Stepper" <stepper@sympedia.de <mailto:stepper@sympedia.de>>
> wrote in message news:fb0bva$odv$2@build.eclipse.org...
> Simon McDuff schrieb:
>> What do you think of the following :
>>
>> CDOSessionImpl could have a failOverStrategy. It just need to be
>> notify when this happen.
>> We will need to wrap every request like the following
>>
>>
>> return new FailOverRequest<CDORevisionImpl>(session)
>> {
>> public CDORevisionImpl sendRequest(int timeout) throws
>> TimeoutException, Exception
>> {
>> // Previous code
>> *return new LoadRevisionRequest(session.getChannel(),
>> id).send(timeout);*
>> }
>> }.send(1000);
>>
>>
>> *FailOverRequest.java*
>> **
>> public class FailOverRequest<REQUEST>
>> {
>>
>> Object session;
>> *public* FailOverRequest(SignalActor<RESULT> sending, Object session)
>> {
>> * this*.session = session;
>> }
>>
>> *public* REQUEST send(*int* timeout) *throws* Exception
>> {
>> TimeoutException timeOutException = *null*;
>> FailOverStrategy failOverStrategy = null;
>> * do*
>> {
>> * try*
>> {
>> * return* signalActor.send(timeout);
>> }
>> * catch*(TimeoutException exeption)
>> {
>> // Could use IManageContainer to get the strategy
>> if (failOverStrategy != null)
>> failOverStrategy =
>> FailOverStrategyFactory.create(repositoryName);
>>
>> IChannel channel=
>> failOverStrategy.requestNewConnector(session);
>>
>> * if* (channel== *null*)
>> * throw* exeption;
>>
>> signalActor.replaceChannel( channel );
>> }
>> } *while* (*true*);
>> }
>>
>>
>> }
>>
>>
>> I tried it with 2 servers... and it worked well when I load
>> objects !!!
> It is an interesting idea to wrap the requests!
> *[Simon] The advantage of wrapping it is the following. If the
> session change channel(between the first and second request)... it
> will change as well.*
> **
>
>
> Maybe it'd even be better if it was not necessary to subclass
> FailoverRequest for each signal to be wrapped.*[Agree.. but we
> will need to modify deeper]*
> I think that it could be possible to make the send() method of
> SignalActor protected and have it called by a generic method of an
> IFailOverStrategy..
> *[I don't understand . It is how it is designed ? *
> *Do you will subclass Signal<Actor> ?? Or SignalActor will know
> about failoverstrategy...]*
> Or *Signal<Actor> implements IFailOverStrategy ??*
>
I'd use a FailOverSignal wrapper similar to the one you proposed.
But I'd create an instance of it within the IFailOverStrategy and pass
the strategy in (instead of pulling it from a factory from within the
signal).
The session must be eliminated from the signal because its basically a
CDO dependency (although it avoids using a CDO interface).
The FailOverSignal should only communicate with the delegate signal and
the strategy.
The strategy should fire events when the FailOverSignal detects/finishes
a failOver situation.
The CDOSessionImpl could listen to these events.

> **
>
> IFailOverStrategy failOverStrategy =
> cdoSession.getFailOverStrategy();
> LoadRevisionRequest<CDORevisionImpl> request = new
> LoadRevisionRequest(session.getChannel(), id).send(timeout);
> long timeout = 2500;
> CDORevisionImpl result = failOverStrategy.send(request,
> timeout);
>
> The fail over strategy implementation could be dependent on
> CDOSession and react for example on the deactivation of the
> IChannel (due to server or network failure).
> What do you think?
> *[Simon] FailOverStrategy will ask for another channel... and the
> Signal<Actor> will change it. Signal<Actor> need to be able to
> change channel right ?*
>
> *[Simon] React on a desactivation of a IChannel... yes but it will
> need to differentiate between when I close the connection and when
> the network has errors. Also CDOSession should not fireEvent
> based on a fail-over... since the lifecycle of CDOSession is not
> desactivate. Right ?*
> *Maybe we should react on another event ... like TimeOutEvent... *
> **
> **
> **
>
>
>
>
> SignalActor
>
>
>
>> CDOSessionImpl.replaceConnector have the following: (maybe I need
>> more things...I`m not sure )
>>
>>
>> EventUtil./removeListener/(channel, channelListener);
>>
>> setConnector(connectr);
>>
>> OpenSessionRequest request = *new* OpenSessionRequest(channel,
>> repositoryName);
>> OpenSessionResult result = request.send();
>> sessionID = result.getSessionID();
>> repositoryUUID = result.getRepositoryUUID();
>>
>>
>>
>> I wasn`t sure if you would like to put the fail-over closer to
>> net4j or not..
> If that is possible (see above) it would of course be better.
>
> Cheers
> /Eike
>
>

--------------020109070407060707000404
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Simon McDuff schrieb:
<blockquote cite="mid:fb14gi$4np$1@build.eclipse.org" type="cite">
<meta http-equiv="Content-Type"
content="text/html;charset=ISO-8859-15">
<meta content="MSHTML 6.00.2900.3157" name="GENERATOR">
<div>
Re: [CDO/NET4J][0.8.0] Failover mechanism [message #94758 is a reply to message #94723] Tue, 28 August 2007 20:32 Go to previous messageGo to next message
Simon Mc Duff is currently offline Simon Mc DuffFriend
Messages: 596
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.

------=_NextPart_000_01F5_01C7E990.FDB357E0
Content-Type: text/plain;
charset="ISO-8859-15"
Content-Transfer-Encoding: quoted-printable

Perfect.. so we agree on a design!! :-)

Did you already did it ? Or I can do it and send you the patch ....




"Eike Stepper" <stepper@sympedia.de> wrote in message =
news:fb1uh6$36j$1@build.eclipse.org...
Simon McDuff schrieb:=20

"Eike Stepper" <stepper@sympedia.de> wrote in message =
news:fb0bva$odv$2@build.eclipse.org...
Simon McDuff schrieb:=20
What do you think of the following :

CDOSessionImpl could have a failOverStrategy. It just need to be =
notify when this happen.
We will need to wrap every request like the following

=20
return new FailOverRequest<CDORevisionImpl>(session)
{
public CDORevisionImpl sendRequest(int timeout) throws =
TimeoutException, Exception
{
// Previous code
return new LoadRevisionRequest(session.getChannel(), =
id).send(timeout);
}
}.send(1000);


FailOverRequest.java

public class FailOverRequest<REQUEST>
{

Object session;
public FailOverRequest(SignalActor<RESULT> sending, Object =
session)
{
this.session =3D session;
}

public REQUEST send(int timeout) throws Exception
{
TimeoutException timeOutException =3D null;
FailOverStrategy failOverStrategy =3D null;
do
{
try
{
return signalActor.send(timeout);
}
catch(TimeoutException exeption)
{
// Could use IManageContainer to get the strategy
if (failOverStrategy !=3D null)
failOverStrategy =3D =
FailOverStrategyFactory.create(repositoryName);

IChannel channel=3D =
failOverStrategy.requestNewConnector(session);

if (channel=3D=3D null)
throw exeption;

signalActor.replaceChannel( channel );=20
}
} while (true);
}


}


I tried it with 2 servers... and it worked well when I load =
objects !!!
It is an interesting idea to wrap the requests!
[Simon] The advantage of wrapping it is the following. If the =
session change channel(between the first and second request)... it will =
change as well.

Maybe it'd even be better if it was not necessary to subclass =
FailoverRequest for each signal to be wrapped.[Agree.. but we will need =
to modify deeper]
I think that it could be possible to make the send() method of =
SignalActor protected and have it called by a generic method of an =
IFailOverStrategy..
[I don't understand . It is how it is designed ?=20
Do you will subclass Signal<Actor> ?? Or SignalActor will know =
about failoverstrategy...]
Or Signal<Actor> implements IFailOverStrategy ??
I'd use a FailOverSignal wrapper similar to the one you proposed.
But I'd create an instance of it within the IFailOverStrategy and pass =
the strategy in (instead of pulling it from a factory from within the =
signal).
The session must be eliminated from the signal because its basically a =
CDO dependency (although it avoids using a CDO interface).
The FailOverSignal should only communicate with the delegate signal =
and the strategy.
The strategy should fire events when the FailOverSignal =
detects/finishes a failOver situation.
The CDOSessionImpl could listen to these events.




IFailOverStrategy failOverStrategy =3D =
cdoSession.getFailOverStrategy();
LoadRevisionRequest<CDORevisionImpl> request =3D new =
LoadRevisionRequest(session.getChannel(), id).send(timeout);
long timeout =3D 2500;
CDORevisionImpl result =3D failOverStrategy.send(request, =
timeout);

The fail over strategy implementation could be dependent on =
CDOSession and react for example on the deactivation of the IChannel =
(due to server or network failure).
What do you think?
[Simon] FailOverStrategy will ask for another channel... and the =
Signal<Actor> will change it. Signal<Actor> need to be able to change =
channel right ?
[Simon] React on a desactivation of a IChannel... yes but it will =
need to differentiate between when I close the connection and when the =
network has errors. Also CDOSession should not fireEvent based on a =
fail-over... since the lifecycle of CDOSession is not desactivate. Right =
?
Maybe we should react on another event ... like TimeOutEvent...=20







SignalActor=20



CDOSessionImpl.replaceConnector have the following: (maybe I =
need more things...I`m not sure )


EventUtil.removeListener(channel, channelListener);

setConnector(connectr);

OpenSessionRequest request =3D new OpenSessionRequest(channel, =
repositoryName);
OpenSessionResult result =3D request.send();
sessionID =3D result.getSessionID();
repositoryUUID =3D result.getRepositoryUUID();



I wasn`t sure if you would like to put the fail-over closer to =
net4j or not..=20

If that is possible (see above) it would of course be better.

Cheers
/Eike



------=_NextPart_000_01F5_01C7E990.FDB357E0
Content-Type: text/html;
charset="ISO-8859-15"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type =
content=3Dtext/html;charset=3DISO-8859-15>
<META content=3D"MSHTML 6.00.2900.3157" name=3DGENERATOR></HEAD>
<BODY text=3D#000000 bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Perfect.. so we agree on a design!!=20
:-)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Did you already did it ? Or I can do it =
and send=20
you the patch ....</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Eike Stepper" &lt;<A=20
href=3D"mailto:stepper@sympedia.de">stepper@sympedia.de</A>&gt; wrote =
in message=20
<A=20
=
href=3D"news:fb1uh6$36j$1@build.eclipse.org">news:fb1uh6$36j$1@build.ecli=
pse.org</A>...</DIV>Simon=20
McDuff schrieb:=20
<BLOCKQUOTE cite=3Dmid:fb14gi$4np$1@build.eclipse.org type=3D"cite">
<META content=3D"MSHTML 6.00.2900.3157" name=3DGENERATOR>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Eike Stepper" &lt;<A href=3D"mailto:stepper@sympedia.de"=20
moz-do-not-send=3D"true">stepper@sympedia.de</A>&gt; wrote in =
message <A=20
href=3D"news:fb0bva$odv$2@build.eclipse.org"=20
=
moz-do-not-send=3D"true">news:fb0bva$odv$2@build.eclipse.org</A>...</DIV>=
Simon=20
McDuff schrieb:=20
<BLOCKQUOTE cite=3Dmid:favvfb$pmt$1@build.eclipse.org =
type=3D"cite">
<META content=3D"MSHTML 6.00.6000.16525" name=3DGENERATOR>
<STYLE></STYLE>

<DIV><FONT face=3DArial size=3D2>What do you think of the =
following=20
:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>CDOSessionImpl could have a=20
failOverStrategy. It just need to be notify when this=20
happen.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>We will need to wrap every =
request like the=20
following</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
</FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>return new=20
FailOverRequest&lt;CDORevisionImpl&gt;(session)</FONT ></DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>{</FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
public=20
CDORevisionImpl sendRequest(int timeout) throws =
TimeoutException,=20
Exception</FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =

{</FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =

&nbsp;&nbsp;&nbsp; // Previous code</FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =

&nbsp;&nbsp;&nbsp; <STRONG>return new=20
LoadRevisionRequest(session.getChannel(),=20
id).send(timeout);</STRONG></FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =

}</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>}.send(1000);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial=20
size=3D2><STRONG>FailOverRequest.java</STRONG></FONT></DIV >
<DIV><STRONG></STRONG>&nbsp;</DIV><FONT face=3DArial size=3D2>
<DIV align=3Dleft><FONT color=3D#7f0055 size=3D2><FONT=20
color=3D#000000>public</FONT></FONT><FONT =
size=3D2>&nbsp;</FONT><FONT=20
size=3D2>class</FONT><FONT size=3D2>=20
FailOverRequest&lt;REQUEST&gt;</FONT></DIV>
<DIV align=3Dleft><FONT size=3D2>{</FONT></DIV>
<DIV align=3Dleft>&nbsp;</DIV>
<DIV align=3Dleft><FONT size=3D2><FONT=20
color=3D#0000c0>Object</FONT>&nbsp;</FONT><FONT color=3D#0000c0=20
size=3D2>session</FONT><FONT size=3D2>;</FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><B><FONT color=3D#7f0055=20
size=3D2>public</FONT></B><FONT size=3D2>=20
FailOverRequest(SignalActor&lt;RESULT&gt; sending, Object=20
session)</FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT =
size=3D2>{</FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><B><FONT =
color=3D#7f0055=20
size=3D2>&nbsp;&nbsp;&nbsp; this</FONT></B><FONT =
size=3D2>.</FONT><FONT=20
color=3D#0000c0 size=3D2>session</FONT><FONT size=3D2> =3D=20
session;</FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT=20
size=3D2>}</FONT></FONT></FONT></DIV>
<DIV align=3Dleft>&nbsp;</DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><B><FONT=20
color=3D#7f0055 size=3D2>public</FONT></B><FONT size=3D2> =
REQUEST=20
send(</FONT><B><FONT color=3D#7f0055 =
size=3D2>int</FONT></B><FONT size=3D2>=20
timeout) </FONT><B><FONT color=3D#7f0055 =
size=3D2>throws</FONT></B><FONT=20
size=3D2> Exception</FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2>{</FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2>&nbsp;&nbsp;&nbsp; TimeoutException timeOutException =
=3D=20
</FONT><B><FONT color=3D#7f0055 size=3D2>null</FONT></B><FONT=20
size=3D2>;</FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2>&nbsp;&nbsp;&nbsp; FailOverStrategy failOverStrategy =
=3D=20
null;</FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><B><FONT color=3D#7f0055 size=3D2>&nbsp;&nbsp;&nbsp;=20
do</FONT></B></FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2>&nbsp;&nbsp;&nbsp;=20
{</FONT></FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><B><FONT color=3D#7f0055 =
size=3D2>&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp;=20
try</FONT></B></FONT></FONT></FONT></FONT></FONT></DIV >
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT =
size=3D2> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =20
{</FONT></FONT></FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><B><FONT color=3D#7f0055=20
size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&nbsp;=20
return</FONT></B><FONT size=3D2>=20
=
signalActor.send(timeout);</FONT></FONT></FONT></FONT></FONT ></FONT></FON=
T></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2>&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp;=20
}</FONT></FONT></FONT></FONT></FONT></FONT></FONT></DIV >
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><B><FONT =
color=3D#7f0055=20
size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
catch</FONT></B><FONT=20
size=3D2>(TimeoutException=20
=
exeption)</FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT=20
size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
{</FONT></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
=
size=3D2> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;=20
// Could use IManageContainer to get the=20
=
strategy</FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT></=
DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT=20
size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp; if=20
(failOverStrategy&nbsp; !=3D=20
=
null)</FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT=20
size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; failOverStrategy =3D=20
FailOverStrategyFactory.create(<FONT color=3D#0000c0 =
size=3D2><FONT=20
=
color=3D#000000>repositoryName</FONT></FONT>);</FONT></FONT ></FONT></FONT=
></FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft>&nbsp;</DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT=20
=
size=3D2> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;IChannel=20
channel=3D failOverStrategy.requestNewConnector(<FONT=20
size=3D2>session</FONT><FONT=20
=
size=3D2>);</FONT></FONT></FONT></FONT></FONT></FONT> </FONT></FONT></FONT=
></DIV>
<DIV align=3Dleft>&nbsp;</DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><B><FONT=20
color=3D#7f0055=20
=
size=3D2> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;if</FONT></B><FONT=20
size=3D2> (channel=3D=3D </FONT><B><FONT color=3D#7f0055=20
size=3D2>null</FONT></B><FONT=20
=
size=3D2>)</FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT>=
</DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><B><FONT color=3D#7f0055 size=3D2>&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; throw</FONT></B><FONT =
size=3D2>=20
=
exeption;</FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT><=
/FONT></DIV>
<DIV align=3Dleft>&nbsp;</DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT color=3D#0000c0=20
=
size=3D2> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;=20
<FONT color=3D#000000>signalActor.</FONT></FONT><FONT=20
size=3D2>replaceChannel( channel );=20
=
</FONT></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT></F=
ONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT=20
=
size=3D2> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;} </FONT></FONT><=
/FONT></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2>&nbsp;&nbsp;&nbsp; } =
</FONT><B><FONT=20
color=3D#7f0055 size=3D2>while</FONT></B><FONT size=3D2> =
(</FONT><B><FONT=20
color=3D#7f0055 size=3D2>true</FONT></B><FONT=20
=
size=3D2>);</FONT></FONT></FONT></FONT></FONT></FONT> </FONT></FONT></FONT=
></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT=20
=
size=3D2>}</FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT>=
</FONT></FONT></DIV>
<DIV align=3Dleft>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT=20
=
size=3D2>}</FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT>=
</FONT></FONT></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT face=3DArial size=3D2>I tried it with 2 =
servers... and it=20
worked well when I load objects=20
=
!!!</FONT></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT>=
</FONT></DIV></FONT></BLOCKQUOTE>
<DIV>It is an interesting idea to wrap the requests!</DIV>
<DIV><FONT face=3DArial size=3D2><STRONG>[Simon] The advantage of =
wrapping=20
it&nbsp;is the following. If the session change channel(between =
the first=20
and second request)... it will change as=20
well.</STRONG></FONT></DIV><STRONG></STRONG></BLOCKQUOTE >
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px">
<DIV><BR>Maybe it'd even be better if it was not necessary to =
subclass=20
FailoverRequest for each signal to be wrapped.<STRONG>[Agree.. but =
we will=20
need to modify deeper]</STRONG><BR>I think that it could be =
possible to=20
make the send() method of SignalActor protected and have it called =
by a=20
generic method of an IFailOverStrategy..</DIV>
<DIV><FONT face=3DArial size=3D2><STRONG>[I don't =
understand&nbsp;. It is how=20
it is designed ?&nbsp;</STRONG></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><STRONG>Do you will subclass=20
Signal&lt;Actor&gt; ?? Or SignalActor will know=20
about&nbsp;failoverstrategy...]</STRONG></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Or =
<STRONG>Signal&lt;Actor&gt;&nbsp;=20
implements IFailOverStrategy=20
??</STRONG></FONT></DIV></BLOCKQUOTE></BLOCKQUOTE>I'd use a =
FailOverSignal=20
wrapper similar to the one you proposed.<BR>But I'd create an instance =
of it=20
within the IFailOverStrategy and pass the strategy in (instead of =
pulling it=20
from a factory from within the signal).<BR>The session must be =
eliminated from=20
the signal because its basically a CDO dependency (although it avoids =
using a=20
CDO interface).<BR>The FailOverSignal should only communicate with the =

delegate signal and the strategy.<BR>The strategy should fire events =
when the=20
FailOverSignal detects/finishes a failOver situation.<BR>The =
CDOSessionImpl=20
could listen to these events.<BR><BR>
<BLOCKQUOTE cite=3Dmid:fb14gi$4np$1@build.eclipse.org type=3D"cite">
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px">
<DIV><STRONG></STRONG><FONT size=3D2><BR></FONT><FONT =
face=3DArial><BR><FONT=20
size=3D2> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; =
IFailOverStrategy=20
failOverStrategy =3D =
cdoSession.getFailOverStrategy();<BR>&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp;&nbsp; =
LoadRevisionRequest&lt;CDORevisionImpl&gt;=20
request =3D new LoadRevisionRequest(session.getChannel(),=20
id).send(timeout);<BR>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; long =
timeout =3D=20
2500;<BR>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; =
CDORevisionImpl&nbsp;=20
result =3D failOverStrategy.send(request, =
timeout);<BR></FONT></FONT><BR>The=20
fail over strategy implementation could be dependent on CDOSession =
and=20
react for example on the deactivation of the IChannel (due to =
server or=20
network failure).<BR>What do you think?<BR><FONT size=3D2><FONT=20
face=3DArial><STRONG>[Simon] FailOverStrategy will ask for another =

channel... and the Signal&lt;Actor&gt; will change it. =
Signal&lt;Actor&gt;=20
need to be able to change channel right=20
?</STRONG></FONT></FONT></DIV></BLOCKQUOTE>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px">
<DIV><STRONG><FONT face=3DArial size=3D2>[Simon] React on a =
desactivation of a=20
IChannel... yes but it will need to differentiate between when I =
close the=20
connection and when the network has errors.&nbsp; Also CDOSession =
should=20
not fireEvent based on a fail-over... since the lifecycle of =
CDOSession is=20
not desactivate. Right ?</FONT></STRONG></DIV>
<DIV><STRONG><FONT face=3DArial size=3D2>Maybe we should react on =
another=20
event ... like TimeOutEvent... </FONT></STRONG></DIV>
<DIV><STRONG></STRONG>&nbsp;</DIV>
<DIV><STRONG></STRONG>&nbsp;</DIV>
<DIV><STRONG></STRONG>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>SignalActor </FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE cite=3Dmid:favvfb$pmt$1@build.eclipse.org =
type=3D"cite"><FONT=20
face=3DArial size=3D2>
<DIV><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT face=3DArial =
size=3D2>CDOSessionImpl.replaceConnector have the=20
following: (maybe I need more things...I`m not sure=20
=
)</FONT></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT></=
FONT></DIV>
<DIV align=3Dleft>&nbsp;</DIV>
<DIV align=3Dleft>&nbsp;</DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT=20
face=3DArial>EventUtil.<I>removeListener</I>(</FONT></FONT ><FONT =

face=3DArial><FONT color=3D#0000c0 size=3D2>channel</FONT><FONT =
size=3D2>,=20
</FONT><FONT color=3D#0000c0 =
size=3D2>channelListener</FONT></FONT><FONT=20
size=3D2><FONT=20
=
face=3DArial>);</FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT></=
FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft>&nbsp;</DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT=20
=
face=3DArial>setConnector(connectr);</FONT></FONT></FONT ></FONT></FONT></=
FONT></FONT></FONT></FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft>&nbsp;</DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT =
face=3DArial>OpenSessionRequest=20
request =3D </FONT></FONT><B><FONT color=3D#7f0055 =
size=3D2><FONT=20
face=3DArial>new</FONT></FONT></B><FONT face=3DArial><FONT =
size=3D2>=20
OpenSessionRequest(</FONT><FONT color=3D#0000c0 =
size=3D2>channel</FONT><FONT=20
size=3D2>, </FONT><FONT color=3D#0000c0=20
size=3D2>repositoryName</FONT></FONT><FONT size=3D2><FONT=20
=
face=3DArial>);</FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT></=
FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT =
face=3DArial>OpenSessionResult=20
result =3D=20
=
request.send();</FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT></=
FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT face=3DArial =
color=3D#0000c0=20
size=3D2>sessionID</FONT><FONT size=3D2><FONT face=3DArial> =3D=20
=
result.getSessionID();</FONT></FONT></FONT></FONT></FONT ></FONT></FONT></=
FONT></FONT></FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
face=3DArial><FONT=20
color=3D#0000c0 size=3D2>repositoryUUID</FONT><FONT size=3D2> =
=3D=20
=
result.getRepositoryUUID();</FONT></FONT></FONT></FONT></FONT ></FONT></FO=
NT></FONT></FONT></FONT></FONT></FONT></FONT></FONT></DIV >
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT face=3DArial =
size=3D2>I wasn`t sure=20
if you would like to put the fail-over closer to net4j or not..=20
=
<BR></FONT></FONT></FONT></FONT></FONT></FONT></FONT> </FONT></FONT></FONT=
></FONT></FONT></FONT></DIV></FONT></BLOCKQUOTE>If=20
that is possible (see above) it would of course be=20
=
better.<BR><BR>Cheers<BR>/Eike<BR><BR><BR></BLOCKQUOTE ></BLOCKQUOTE></BLO=
CKQUOTE></BODY></HTML>

------=_NextPart_000_01F5_01C7E990.FDB357E0--
Re: [CDO/NET4J][0.8.0] Failover mechanism [message #94822 is a reply to message #94758] Wed, 29 August 2007 06:38 Go to previous message
Eclipse UserFriend
Originally posted by: stepper.sympedia.de

This is a multi-part message in MIME format.
--------------090906030801030003040504
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Simon McDuff schrieb:
> Perfect.. so we agree on a design!! :-)
>
> Did you already did it ? Or I can do it and send you the patch ....
I'll give it a try ;-)

Cheers
/Eike



--------------090906030801030003040504
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Simon McDuff schrieb:
<blockquote cite="mid:fb20of$7bt$1@build.eclipse.org" type="cite">
<meta http-equiv="Content-Type"
content="text/html;charset=ISO-8859-15">
<meta content="MSHTML 6.00.2900.3157" name="GENERATOR">
<div><font face="Arial" size="2">Perfect.. so we agree on a design!!
:-)</font></div>
<div>
Re: [CDO/NET4J][0.8.0] Failover mechanism [message #609536 is a reply to message #94261] Mon, 27 August 2007 14:55 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6632
Registered: July 2009
Senior Member
Simon,

That's of course also an interesting feature. You should add a feature
request for it.
But, to be honest, I don't believe that I'm able to implement it in the
very near future because there are many other things that will take time.

If you have an idea how to implement this feature or even have a patch
I'd appreciate to discuss/review it with you ;-)

Cheers
/Eike



Simon McDuff schrieb:
> I`m interested in a failover strategy for CDO/NET4J.
>
> Basically we have many CDOServer. If one of them fail, I would like to
> redirect clients connected to the failed CDO server
> to another one and continue like nothing happened.
>
> Let me know if you have or interested in such mechanism.
>
>
>
>


Re: [CDO/NET4J][0.8.0] Failover mechanism [message #609539 is a reply to message #94267] Mon, 27 August 2007 15:00 Go to previous message
Simon Mc Duff is currently offline Simon Mc DuffFriend
Messages: 596
Registered: July 2009
Senior Member
https://bugs.eclipse.org/bugs/show_bug.cgi?id=201267



"Eike Stepper" <stepper@sympedia.de> wrote in message
news:fauokl$frt$3@build.eclipse.org...
> Simon,
>
> That's of course also an interesting feature. You should add a feature
> request for it.
> But, to be honest, I don't believe that I'm able to implement it in the
> very near future because there are many other things that will take time.
>
> If you have an idea how to implement this feature or even have a patch I'd
> appreciate to discuss/review it with you ;-)
>
> Cheers
> /Eike
>
>
>
> Simon McDuff schrieb:
>> I`m interested in a failover strategy for CDO/NET4J.
>>
>> Basically we have many CDOServer. If one of them fail, I would like to
>> redirect clients connected to the failed CDO server
>> to another one and continue like nothing happened.
>>
>> Let me know if you have or interested in such mechanism.
>>
>>
>>
>>
Re: [CDO/NET4J][0.8.0] Failover mechanism [message #609544 is a reply to message #94267] Tue, 28 August 2007 01:58 Go to previous message
Simon Mc Duff is currently offline Simon Mc DuffFriend
Messages: 596
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.

------=_NextPart_000_01F6_01C7E8F5.571D5480
Content-Type: text/plain;
charset="ISO-8859-15"
Content-Transfer-Encoding: quoted-printable

What do you think of the following :

CDOSessionImpl could have a failOverStrategy. It just need to be notify =
when this happen.
We will need to wrap every request like the following

=20
return new FailOverRequest<CDORevisionImpl>(session)
{
public CDORevisionImpl sendRequest(int timeout) throws =
TimeoutException, Exception
{
// Previous code
return new LoadRevisionRequest(session.getChannel(), =
id).send(timeout);
}
}.send(1000);


FailOverRequest.java

public abstract class FailOverRequest<REQUEST>
{
CDOSessionImpl session;
public FailOverRequest(CDOSessionImpl session)
{
this.session =3D session;
}

public REQUEST send(int timeout) throws Exception
{
TimeoutException timeOutException =3D null;
FailOverStrategy failOverStrategy =3D null;
do
{
try
{
return sendRequest(timeout);
}
catch(TimeoutException exeption)
{
// Could use IManageContainer to get the strategy
if (failOverStrategy !=3D null)
failOverStrategy =3D =
FailOverStrategyFactory.create(repositoryName);

IConnector connector =3D =
failOverStrategy.requestNewConnector(session);

if (connector =3D=3D null)
throw exeption;

session.replaceConnector(connector);=20
}
} while (true);
}

public abstract REQUEST sendRequest(int timeout) throws =
TimeoutException, Exception;

}


I tried it with 2 servers... and it worked well when I load objects !!!

CDOSessionImpl.replaceConnector have the following: (maybe I need more =
things...I`m not sure )


EventUtil.removeListener(channel, channelListener);

setConnector(connectr);

OpenSessionRequest request =3D new OpenSessionRequest(channel, =
repositoryName);
OpenSessionResult result =3D request.send();
sessionID =3D result.getSessionID();
repositoryUUID =3D result.getRepositoryUUID();



I wasn`t sure if you would like to put the fail-over closer to net4j or =
not..=20

Let me know what you think.


"Eike Stepper" <stepper@sympedia.de> a =E9crit dans le message de news: =
fauokl$frt$3@build.eclipse.org...
> Simon,
>=20
> That's of course also an interesting feature. You should add a feature =

> request for it.
> But, to be honest, I don't believe that I'm able to implement it in =
the=20
> very near future because there are many other things that will take =
time.
>=20
> If you have an idea how to implement this feature or even have a patch =

> I'd appreciate to discuss/review it with you ;-)
>=20
> Cheers
> /Eike
>=20
>=20
>=20
> Simon McDuff schrieb:
>> I`m interested in a failover strategy for CDO/NET4J.
>>
>> Basically we have many CDOServer. If one of them fail, I would like =
to=20
>> redirect clients connected to the failed CDO server
>> to another one and continue like nothing happened.
>>
>> Let me know if you have or interested in such mechanism.
>>
>>
>>
>>
------=_NextPart_000_01F6_01C7E8F5.571D5480
Content-Type: text/html;
charset="ISO-8859-15"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-15">
<META content=3D"MSHTML 6.00.6000.16525" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>What do you think of the following =
:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>CDOSessionImpl could have a =
failOverStrategy. It=20
just need to be notify when this happen.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>We will need to wrap every request like =
the=20
following</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; </FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>return new=20
FailOverRequest&lt;CDORevisionImpl&gt;(session)</FONT ></DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>{</FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; public=20
CDORevisionImpl sendRequest(int timeout) throws TimeoutException,=20
Exception</FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
{</FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp; //=20
Previous code</FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
<STRONG>return new LoadRevisionRequest(session.getChannel(),=20
id).send(timeout);</STRONG></FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
}</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>}.send(1000);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial =
size=3D2><STRONG>FailOverRequest.java</STRONG></FONT></DIV >
<DIV><STRONG><FONT face=3DArial =
size=3D2></FONT></STRONG>&nbsp;</DIV><FONT=20
face=3DArial size=3D2><FONT color=3D#7f0055 size=3D2>
<DIV align=3Dleft><FONT color=3D#000000>public</FONT></FONT><FONT =
size=3D2>=20
</FONT><FONT size=3D2>abstract</FONT><FONT size=3D2> </FONT><FONT=20
size=3D2>class</FONT><FONT size=3D2> =
FailOverRequest&lt;REQUEST&gt;</DIV>
<DIV align=3Dleft>{</DIV>
<DIV align=3Dleft>CDOSessionImpl </FONT><FONT color=3D#0000c0=20
size=3D2>session</FONT><FONT size=3D2>;</DIV>
<DIV align=3Dleft></FONT><B><FONT color=3D#7f0055 =
size=3D2>public</B></FONT><FONT=20
size=3D2> FailOverRequest(CDOSessionImpl session)</DIV>
<DIV align=3Dleft>{</DIV>
<DIV align=3Dleft></FONT><B><FONT color=3D#7f0055 =
size=3D2>&nbsp;&nbsp;&nbsp;=20
this</B></FONT><FONT size=3D2>.</FONT><FONT color=3D#0000c0=20
size=3D2>session</FONT><FONT size=3D2> =3D session;</DIV>
<DIV align=3Dleft>}</DIV>
<DIV align=3Dleft>&nbsp;</DIV>
<DIV align=3Dleft></FONT><B><FONT color=3D#7f0055 =
size=3D2>public</B></FONT><FONT=20
size=3D2> REQUEST send(</FONT><B><FONT color=3D#7f0055 =
size=3D2>int</B></FONT><FONT=20
size=3D2> timeout) </FONT><B><FONT color=3D#7f0055 =
size=3D2>throws</B></FONT><FONT=20
size=3D2> Exception</DIV>
<DIV align=3Dleft>{</DIV>
<DIV align=3Dleft>&nbsp;&nbsp;&nbsp; TimeoutException timeOutException =
=3D=20
</FONT><B><FONT color=3D#7f0055 size=3D2>null</B></FONT><FONT =
size=3D2>;</FONT></DIV>
<DIV align=3Dleft><FONT size=3D2>&nbsp;&nbsp;&nbsp; FailOverStrategy=20
failOverStrategy =3D null;</DIV>
<DIV align=3Dleft></FONT><B><FONT color=3D#7f0055 =
size=3D2>&nbsp;&nbsp;&nbsp;=20
do</DIV></B></FONT><FONT size=3D2>
<DIV align=3Dleft>&nbsp;&nbsp;&nbsp; {</DIV>
<DIV align=3Dleft></FONT><B><FONT color=3D#7f0055 =
size=3D2>&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; try</DIV></B></FONT><FONT size=3D2>
<DIV align=3Dleft> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</DIV>
<DIV align=3Dleft></FONT><B><FONT color=3D#7f0055 =
size=3D2>&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; return</B></FONT><FONT size=3D2>=20
sendRequest(timeout);</DIV>
<DIV align=3Dleft>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</DIV>
<DIV align=3Dleft></FONT><B><FONT color=3D#7f0055 =
size=3D2>&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; catch</B></FONT><FONT size=3D2>(TimeoutException=20
exeption)</DIV>
<DIV align=3Dleft>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</DIV>
<DIV align=3Dleft><FONT=20
size=3D2> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p; //=20
Could use IManageContainer to get the strategy</FONT></DIV>
<DIV align=3Dleft>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp; if=20
(failOverStrategy&nbsp; !=3D null)</DIV>
<DIV align=3Dleft>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; failOverStrategy =3D=20
FailOverStrategyFactory.create(<FONT color=3D#0000c0 size=3D2><FONT=20
color=3D#000000>repositoryName</FONT></FONT>);</DIV>
<DIV align=3Dleft>&nbsp;</DIV>
<DIV=20
align=3Dleft> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;IConnector=20
connector =3D failOverStrategy.requestNewConnector(<FONT color=3D#0000c0 =

size=3D2>session</FONT><FONT size=3D2>);</FONT></DIV>
<DIV align=3Dleft>&nbsp;</DIV></FONT><FONT size=3D2>
<DIV align=3Dleft></FONT><B><FONT color=3D#7f0055=20
size=3D2> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;if</B></FONT><FONT=20
size=3D2> (connector =3D=3D </FONT><B><FONT color=3D#7f0055 =
size=3D2>null</B></FONT><FONT=20
size=3D2>)</DIV>
<DIV align=3Dleft></FONT><B><FONT color=3D#7f0055 =
size=3D2>&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; throw</B></FONT><FONT size=3D2> =
exeption;</FONT></DIV>
<DIV align=3Dleft><FONT size=3D2>&nbsp;</DIV>
<DIV align=3Dleft></FONT><FONT color=3D#0000c0 =
size=3D2>&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; session</FONT><FONT=20
size=3D2>.replaceConnector(connector); </DIV>
<DIV =
align=3Dleft> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;} </DIV>
<DIV align=3Dleft>&nbsp;&nbsp;&nbsp; } </FONT><B><FONT color=3D#7f0055=20
size=3D2>while</B></FONT><FONT size=3D2> (</FONT><B><FONT =
color=3D#7f0055=20
size=3D2>true</B></FONT><FONT size=3D2>);</DIV>
<DIV align=3Dleft>}</DIV>
<DIV align=3Dleft></FONT><B><FONT color=3D#7f0055 =
size=3D2></FONT></B>&nbsp;</DIV>
<DIV align=3Dleft><B><FONT color=3D#7f0055 =
size=3D2>public</B></FONT><FONT size=3D2>=20
</FONT><B><FONT color=3D#7f0055 size=3D2>abstract</B></FONT><FONT =
size=3D2> REQUEST=20
sendRequest(</FONT><B><FONT color=3D#7f0055 size=3D2>int</B></FONT><FONT =
size=3D2>=20
timeout) </FONT><B><FONT color=3D#7f0055 size=3D2>throws</B></FONT><FONT =
size=3D2>=20
TimeoutException, Exception;</DIV>
<DIV>&nbsp;</DIV>
<DIV>}</DIV></FONT></FONT>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I tried it with 2 servers... and it =
worked well=20
when I load objects !!!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>CDOSessionImpl.replaceConnector have =
the following:=20
(maybe I need more things...I`m not sure )</FONT></DIV><FONT size=3D2>
<DIV align=3Dleft><FONT face=3DArial></FONT>&nbsp;</DIV>
<DIV align=3Dleft><FONT face=3DArial></FONT>&nbsp;</DIV>
<DIV align=3Dleft><FONT=20
face=3DArial>EventUtil.<I>removeListener</I>(</FONT></FONT ><FONT =
face=3DArial><FONT=20
color=3D#0000c0 size=3D2>channel</FONT><FONT size=3D2>, </FONT><FONT =
color=3D#0000c0=20
size=3D2>channelListener</FONT></FONT><FONT size=3D2><FONT=20
face=3DArial>);</FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial></FONT>&nbsp;</DIV>
<DIV align=3Dleft><FONT =
face=3DArial>setConnector(connectr);</FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial></FONT>&nbsp;</DIV>
<DIV align=3Dleft><FONT face=3DArial>OpenSessionRequest request =3D=20
</FONT></FONT><B><FONT color=3D#7f0055 size=3D2><FONT=20
face=3DArial>new</FONT></B></FONT><FONT face=3DArial><FONT size=3D2>=20
OpenSessionRequest(</FONT><FONT color=3D#0000c0 =
size=3D2>channel</FONT><FONT=20
size=3D2>, </FONT><FONT color=3D#0000c0 =
size=3D2>repositoryName</FONT></FONT><FONT=20
size=3D2><FONT face=3DArial>);</FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial>OpenSessionResult result =3D=20
request.send();</FONT></DIV>
<DIV align=3Dleft></FONT><FONT face=3DArial color=3D#0000c0=20
size=3D2>sessionID</FONT><FONT size=3D2><FONT face=3DArial> =3D=20
result.getSessionID();</FONT></DIV>
<DIV align=3Dleft></FONT><FONT face=3DArial><FONT color=3D#0000c0=20
size=3D2>repositoryUUID</FONT><FONT size=3D2> =3D=20
result.getRepositoryUUID();</DIV></FONT></FONT>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I wasn`t sure if you would like to put =
the=20
fail-over closer to net4j or not..&nbsp;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Let me know what you =
think.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT><FONT face=3DArial =
size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>"Eike Stepper" &lt;</FONT><A=20
href=3D"mailto:stepper@sympedia.de"><FONT face=3DArial=20
size=3D2>stepper@sympedia.de</FONT></A><FONT face=3DArial size=3D2>&gt; =
a =E9crit dans=20
le message de news: </FONT><A =
href=3D"mailto:fauokl$frt$3@build.eclipse.org"><FONT=20
face=3DArial size=3D2>fauokl$frt$3@build.eclipse.org</FONT></A><FONT =
face=3DArial=20
size=3D2>...</FONT></DIV><FONT face=3DArial size=3D2>&gt; Simon,<BR>&gt; =
<BR>&gt;=20
That's of course also an interesting feature. You should add a feature =
<BR>&gt;=20
request for it.<BR>&gt; But, to be honest, I don't believe that I'm able =
to=20
implement it in the <BR>&gt; very near future because there are many =
other=20
things that will take time.<BR>&gt; <BR>&gt; If you have an idea how to=20
implement this feature or even have a patch <BR>&gt; I'd appreciate to=20
discuss/review it with you ;-)<BR>&gt; <BR>&gt; Cheers<BR>&gt; =
/Eike<BR>&gt;=20
<BR>&gt; <BR>&gt; <BR>&gt; Simon McDuff schrieb:<BR>&gt;&gt; I`m =
interested in a=20
failover strategy for CDO/NET4J.<BR>&gt;&gt;<BR>&gt;&gt; Basically we =
have many=20
CDOServer. If one of them fail, I would like to <BR>&gt;&gt; redirect =
clients=20
connected to the failed CDO server<BR>&gt;&gt; to another one and =
continue like=20
nothing happened.<BR>&gt;&gt;<BR>&gt;&gt; Let me know if you have or =
interested=20
in such=20
mechanism.<BR>&gt;&gt;<BR>&gt;&gt;<BR>&gt;&gt; <BR>&gt;&gt;</FONT></BODY><=
/HTML>

------=_NextPart_000_01F6_01C7E8F5.571D5480--
Re: [CDO/NET4J][0.8.0] Failover mechanism [message #609546 is a reply to message #94276] Tue, 28 August 2007 05:31 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6632
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------040207090000070602060408
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Simon McDuff schrieb:
> What do you think of the following :
>
> CDOSessionImpl could have a failOverStrategy. It just need to be
> notify when this happen.
> We will need to wrap every request like the following
>
>
> return new FailOverRequest<CDORevisionImpl>(session)
> {
> public CDORevisionImpl sendRequest(int timeout) throws
> TimeoutException, Exception
> {
> // Previous code
> *return new LoadRevisionRequest(session.getChannel(),
> id).send(timeout);*
> }
> }.send(1000);
>
>
> *FailOverRequest.java*
> **
> public abstract class FailOverRequest<REQUEST>
> {
> CDOSessionImpl session;
> *public* FailOverRequest(CDOSessionImpl session)
> {
> * this*.session = session;
> }
>
> *public* REQUEST send(*int* timeout) *throws* Exception
> {
> TimeoutException timeOutException = *null*;
> FailOverStrategy failOverStrategy = null;
> * do*
> {
> * try*
> {
> * return* sendRequest(timeout);
> }
> * catch*(TimeoutException exeption)
> {
> // Could use IManageContainer to get the strategy
> if (failOverStrategy != null)
> failOverStrategy =
> FailOverStrategyFactory.create(repositoryName);
>
> IConnector connector =
> failOverStrategy.requestNewConnector(session);
>
> * if* (connector == *null*)
> * throw* exeption;
>
> session.replaceConnector(connector);
> }
> } *while* (*true*);
> }
>
> *public* *abstract* REQUEST sendRequest(*int* timeout) *throws*
> TimeoutException, Exception;
>
> }
>
>
> I tried it with 2 servers... and it worked well when I load objects !!!
It is an interesting idea to wrap the requests!
Maybe it'd even be better if it was not necessary to subclass
FailoverRequest for each signal to be wrapped.
I think that it could be possible to make the send() method of
SignalActor protected and have it called by a generic method of an
IFailOverStrategy:


IFailOverStrategy failOverStrategy =
cdoSession.getFailOverStrategy();
LoadRevisionRequest<CDORevisionImpl> request = new
LoadRevisionRequest(session.getChannel(), id).send(timeout);
long timeout = 2500;
CDORevisionImpl result = failOverStrategy.send(request, timeout);

The fail over strategy implementation could be dependent on CDOSession
and react for example on the deactivation of the IChannel (due to server
or network failure).
What do you think?


> CDOSessionImpl.replaceConnector have the following: (maybe I need more
> things...I`m not sure )
>
>
> EventUtil./removeListener/(channel, channelListener);
>
> setConnector(connectr);
>
> OpenSessionRequest request = *new* OpenSessionRequest(channel,
> repositoryName);
> OpenSessionResult result = request.send();
> sessionID = result.getSessionID();
> repositoryUUID = result.getRepositoryUUID();
>
>
>
> I wasn`t sure if you would like to put the fail-over closer to net4j
> or not..
If that is possible (see above) it would of course be better.

Cheers
/Eike



--------------040207090000070602060408
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Simon McDuff schrieb:
<blockquote cite="mid:favvfb$pmt$1@build.eclipse.org" type="cite">
<meta http-equiv="Content-Type" content="text/html; ">
<meta content="MSHTML 6.00.6000.16525" name="GENERATOR">
<style></style>
<div><font face="Arial" size="2">What do you think of the following :</font></div>
<div>


Re: [CDO/NET4J][0.8.0] Failover mechanism [message #609565 is a reply to message #94355] Tue, 28 August 2007 12:30 Go to previous message
Simon Mc Duff is currently offline Simon Mc DuffFriend
Messages: 596
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.

------=_NextPart_000_010F_01C7E94D.A486F4D0
Content-Type: text/plain;
charset="ISO-8859-15"
Content-Transfer-Encoding: quoted-printable


"Eike Stepper" <stepper@sympedia.de> wrote in message =
news:fb0bva$odv$2@build.eclipse.org...
Simon McDuff schrieb:=20
What do you think of the following :

CDOSessionImpl could have a failOverStrategy. It just need to be =
notify when this happen.
We will need to wrap every request like the following

=20
return new FailOverRequest<CDORevisionImpl>(session)
{
public CDORevisionImpl sendRequest(int timeout) throws =
TimeoutException, Exception
{
// Previous code
return new LoadRevisionRequest(session.getChannel(), =
id).send(timeout);
}
}.send(1000);


FailOverRequest.java

public class FailOverRequest<REQUEST>
{

Object session;
public FailOverRequest(SignalActor<RESULT> sending, Object session)
{
this.session =3D session;
}

public REQUEST send(int timeout) throws Exception
{
TimeoutException timeOutException =3D null;
FailOverStrategy failOverStrategy =3D null;
do
{
try
{
return signalActor.send(timeout);
}
catch(TimeoutException exeption)
{
// Could use IManageContainer to get the strategy
if (failOverStrategy !=3D null)
failOverStrategy =3D =
FailOverStrategyFactory.create(repositoryName);

IChannel channel=3D =
failOverStrategy.requestNewConnector(session);

if (channel=3D=3D null)
throw exeption;

signalActor.replaceChannel( channel );=20
}
} while (true);
}


}


I tried it with 2 servers... and it worked well when I load objects =
!!!
It is an interesting idea to wrap the requests!
[Simon] The advantage of wrapping it is the following. If the session =
change channel(between the first and second request)... it will change =
as well.

Maybe it'd even be better if it was not necessary to subclass =
FailoverRequest for each signal to be wrapped.[Agree.. but we will need =
to modify deeper]
I think that it could be possible to make the send() method of =
SignalActor protected and have it called by a generic method of an =
IFailOverStrategy..
[I don't understand . It is how it is designed ?=20
Do you will subclass Signal<Actor> ?? Or SignalActor will know about =
failoverstrategy...]
Or Signal<Actor> implements IFailOverStrategy ??


IFailOverStrategy failOverStrategy =3D =
cdoSession.getFailOverStrategy();
LoadRevisionRequest<CDORevisionImpl> request =3D new =
LoadRevisionRequest(session.getChannel(), id).send(timeout);
long timeout =3D 2500;
CDORevisionImpl result =3D failOverStrategy.send(request, =
timeout);

The fail over strategy implementation could be dependent on CDOSession =
and react for example on the deactivation of the IChannel (due to server =
or network failure).
What do you think?
[Simon] FailOverStrategy will ask for another channel... and the =
Signal<Actor> will change it. Signal<Actor> need to be able to change =
channel right ?
[Simon] React on a desactivation of a IChannel... yes but it will need =
to differentiate between when I close the connection and when the =
network has errors. Also CDOSession should not fireEvent based on a =
fail-over... since the lifecycle of CDOSession is not desactivate. Right =
?
Maybe we should react on another event ... like TimeOutEvent...=20







SignalActor=20



CDOSessionImpl.replaceConnector have the following: (maybe I need =
more things...I`m not sure )


EventUtil.removeListener(channel, channelListener);

setConnector(connectr);

OpenSessionRequest request =3D new OpenSessionRequest(channel, =
repositoryName);
OpenSessionResult result =3D request.send();
sessionID =3D result.getSessionID();
repositoryUUID =3D result.getRepositoryUUID();



I wasn`t sure if you would like to put the fail-over closer to net4j =
or not..=20

If that is possible (see above) it would of course be better.

Cheers
/Eike



------=_NextPart_000_010F_01C7E94D.A486F4D0
Content-Type: text/html;
charset="ISO-8859-15"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type =
content=3Dtext/html;charset=3DISO-8859-15>
<META content=3D"MSHTML 6.00.2900.3157" name=3DGENERATOR></HEAD>
<BODY text=3D#000000 bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Eike Stepper" &lt;<A=20
href=3D"mailto:stepper@sympedia.de">stepper@sympedia.de</A>&gt; wrote =
in message=20
<A=20
=
href=3D"news:fb0bva$odv$2@build.eclipse.org">news:fb0bva$odv$2@build.ecli=
pse.org</A>...</DIV>Simon=20
McDuff schrieb:=20
<BLOCKQUOTE cite=3Dmid:favvfb$pmt$1@build.eclipse.org type=3D"cite">
<META content=3D"MSHTML 6.00.6000.16525" name=3DGENERATOR>
<STYLE></STYLE>

<DIV><FONT face=3DArial size=3D2>What do you think of the following=20
:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>CDOSessionImpl could have a =
failOverStrategy.=20
It just need to be notify when this happen.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>We will need to wrap every request =
like the=20
following</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; </FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>return new=20
FailOverRequest&lt;CDORevisionImpl&gt;(session)</FONT ></DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>{</FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
public=20
CDORevisionImpl sendRequest(int timeout) throws TimeoutException,=20
Exception</FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
{</FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; // Previous code</FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; <STRONG>return new=20
LoadRevisionRequest(session.getChannel(),=20
id).send(timeout);</STRONG></FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
}</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>}.send(1000);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial=20
size=3D2><STRONG>FailOverRequest.java</STRONG></FONT></DIV >
<DIV><STRONG></STRONG>&nbsp;</DIV><FONT face=3DArial size=3D2><FONT=20
color=3D#7f0055 size=3D2></FONT>
<DIV align=3Dleft><FONT color=3D#7f0055 size=3D2><FONT=20
color=3D#000000>public</FONT></FONT><FONT =
size=3D2>&nbsp;</FONT><FONT=20
size=3D2>class</FONT><FONT size=3D2> =
FailOverRequest&lt;REQUEST&gt;</FONT></DIV>
<DIV align=3Dleft><FONT size=3D2>{</FONT></DIV>
<DIV align=3Dleft><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV align=3Dleft><FONT size=3D2><FONT=20
color=3D#0000c0>Object</FONT>&nbsp;</FONT><FONT color=3D#0000c0=20
size=3D2>session</FONT><FONT size=3D2>;</FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><B><FONT color=3D#7f0055=20
size=3D2>public</FONT></B><FONT size=3D2>=20
FailOverRequest(SignalActor&lt;RESULT&gt; sending, Object=20
session)</FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT =
size=3D2>{</FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><B><FONT =
color=3D#7f0055=20
size=3D2>&nbsp;&nbsp;&nbsp; this</FONT></B><FONT =
size=3D2>.</FONT><FONT=20
color=3D#0000c0 size=3D2>session</FONT><FONT size=3D2> =3D=20
session;</FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT=20
size=3D2>}</FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT=20
size=3D2></FONT></FONT></FONT>&nbsp;</DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><B><FONT=20
color=3D#7f0055 size=3D2>public</FONT></B><FONT size=3D2> REQUEST=20
send(</FONT><B><FONT color=3D#7f0055 size=3D2>int</FONT></B><FONT =
size=3D2>=20
timeout) </FONT><B><FONT color=3D#7f0055 =
size=3D2>throws</FONT></B><FONT size=3D2>=20
Exception</FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =

size=3D2>{</FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =

size=3D2>&nbsp;&nbsp;&nbsp; TimeoutException timeOutException =3D=20
</FONT><B><FONT color=3D#7f0055 size=3D2>null</FONT></B><FONT=20
size=3D2>;</FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =

size=3D2>&nbsp;&nbsp;&nbsp; FailOverStrategy failOverStrategy =3D=20
null;</FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><B><FONT=20
color=3D#7f0055 size=3D2>&nbsp;&nbsp;&nbsp;=20
do</FONT></B></FONT></FONT></FONT></FONT></DIV><FONT size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT=20
size=3D2></FONT></FONT></FONT></FONT></FONT>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2>&nbsp;&nbsp;&nbsp; =
{</FONT></FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><B><FONT color=3D#7f0055 size=3D2>&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
try</FONT></B></FONT></FONT></FONT></FONT></FONT></DIV ><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT=20
size=3D2></FONT></FONT></FONT></FONT></FONT></FONT>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =20
{</FONT></FONT></FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><B><FONT color=3D#7f0055 =
size=3D2>&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; return</FONT></B><FONT =
size=3D2>=20
=
signalActor.send(timeout);</FONT></FONT></FONT></FONT></FONT ></FONT></FON=
T></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2>&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
}</FONT></FONT></FONT></FONT></FONT></FONT></FONT></DIV >
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><B><FONT color=3D#7f0055=20
size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; catch</FONT></B><FONT =

size=3D2>(TimeoutException=20
=
exeption)</FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2>&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp;=20
{</FONT></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT=20
=
size=3D2> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p; //=20
Could use IManageContainer to get the=20
=
strategy</FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT></=
DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2>&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (failOverStrategy&nbsp; =
!=3D=20
null)</FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2>&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
failOverStrategy =3D FailOverStrategyFactory.create(<FONT =
color=3D#0000c0=20
size=3D2><FONT=20
=
color=3D#000000>repositoryName</FONT></FONT>);</FONT></FONT ></FONT></FONT=
></FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT=20
=
size=3D2></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT>&nbsp;</=
DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT=20
=
size=3D2> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;IChannel=20
channel=3D failOverStrategy.requestNewConnector(<FONT=20
size=3D2>session</FONT><FONT=20
=
size=3D2>);</FONT></FONT></FONT></FONT></FONT></FONT> </FONT></FONT></FONT=
></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT=20
=
size=3D2></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT>&nbsp;</=
DIV><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT=20
size=3D2></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><B><FONT =
color=3D#7f0055=20
=
size=3D2> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;if</FONT></B><FONT=20
size=3D2> (channel=3D=3D </FONT><B><FONT color=3D#7f0055 =
size=3D2>null</FONT></B><FONT=20
=
size=3D2>)</FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT>=
</DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><B><FONT=20
color=3D#7f0055 size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
throw</FONT></B><FONT size=3D2>=20
=
exeption;</FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT><=
/FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
=
size=3D2></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT><=
/FONT>&nbsp;</DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT color=3D#0000c0=20
=
size=3D2> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;=20
<FONT color=3D#000000>signalActor.</FONT></FONT><FONT =
size=3D2>replaceChannel(=20
channel );=20
=
</FONT></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT></F=
ONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT=20
=
size=3D2> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;} </FONT></FONT><=
/FONT></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2>&nbsp;&nbsp;&nbsp; } </FONT><B><FONT =
color=3D#7f0055=20
size=3D2>while</FONT></B><FONT size=3D2> (</FONT><B><FONT =
color=3D#7f0055=20
size=3D2>true</FONT></B><FONT=20
=
size=3D2>);</FONT></FONT></FONT></FONT></FONT></FONT> </FONT></FONT></FONT=
></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT=20
=
size=3D2>}</FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT>=
</FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT=20
=
size=3D2></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT><=
/FONT></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT=20
=
size=3D2></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT><=
/FONT></FONT></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT=20
=
size=3D2>}</FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT>=
</FONT></FONT></FONT></DIV><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT=20
=
size=3D2></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT><=
/FONT>
<DIV><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT=20
=
size=3D2></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT><=
/FONT>&nbsp;</DIV>
<DIV><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT=20
=
size=3D2></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT><=
/FONT>&nbsp;</DIV>
<DIV><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT face=3DArial=20
size=3D2>I tried it with 2 servers... and it worked well when I load =
objects=20
=
!!!</FONT></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT>=
</FONT></DIV></FONT></BLOCKQUOTE>
<DIV>It is an interesting idea to wrap the requests!</DIV>
<DIV><FONT face=3DArial size=3D2><STRONG>[Simon] The advantage of =
wrapping=20
it&nbsp;is the following. If the session change channel(between the =
first and=20
second request)... it will change as =
well.</STRONG></FONT></DIV><STRONG><FONT=20
face=3DArial size=3D2></FONT></STRONG></BLOCKQUOTE>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV><FONT face=3DArial size=3D2></FONT><FONT face=3DArial =
size=3D2></FONT><FONT=20
face=3DArial size=3D2></FONT><BR>Maybe it'd even be better if it was =
not necessary=20
to subclass FailoverRequest for each signal to be =
wrapped.<STRONG>[Agree.. but=20
we will need to modify deeper]</STRONG><BR>I think that it could be =
possible=20
to make the send() method of SignalActor protected and have it called =
by a=20
generic method of an IFailOverStrategy..</DIV>
<DIV><FONT face=3DArial size=3D2><STRONG>[I don't understand&nbsp;. It =
is how it=20
is designed ?&nbsp;</STRONG></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><STRONG>Do you will subclass =
Signal&lt;Actor&gt;=20
?? Or SignalActor will know=20
about&nbsp;failoverstrategy...]</STRONG></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Or <STRONG>Signal&lt;Actor&gt;&nbsp; =
implements=20
IFailOverStrategy ??</STRONG></FONT></DIV>
<DIV><STRONG><FONT face=3DArial size=3D2></FONT></STRONG><FONT=20
size=3D2><BR></FONT><FONT face=3DArial><BR><FONT=20
size=3D2> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; IFailOverStrategy=20
failOverStrategy =3D cdoSession.getFailOverStrategy();<BR>&nbsp;&nbsp; =

&nbsp;&nbsp;&nbsp;&nbsp; LoadRevisionRequest&lt;CDORevisionImpl&gt; =
request =3D=20
new LoadRevisionRequest(session.getChannel(),=20
id).send(timeout);<BR>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; long =
timeout =3D=20
2500;<BR>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; CDORevisionImpl&nbsp; =
result =3D=20
failOverStrategy.send(request, timeout);<BR></FONT></FONT><BR>The fail =
over=20
strategy implementation could be dependent on CDOSession and react for =
example=20
on the deactivation of the IChannel (due to server or network=20
failure).<BR>What do you think?<BR><FONT size=3D2><FONT=20
face=3DArial><STRONG>[Simon] FailOverStrategy will ask for another =
channel...=20
and the Signal&lt;Actor&gt; will change it. Signal&lt;Actor&gt; need =
to be=20
able to change channel right =
?</STRONG></FONT></FONT></DIV></BLOCKQUOTE>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV><STRONG><FONT face=3DArial size=3D2>[Simon] React on a =
desactivation of a=20
IChannel... yes but it will need to differentiate between when I close =
the=20
connection and when the network has errors.&nbsp; Also CDOSession =
should not=20
fireEvent based on a fail-over... since the lifecycle of CDOSession is =
not=20
desactivate. Right ?</FONT></STRONG></DIV>
<DIV><STRONG><FONT face=3DArial size=3D2>Maybe we should react on =
another event=20
... like TimeOutEvent... </FONT></STRONG></DIV>
<DIV><STRONG><FONT face=3DArial size=3D2></FONT></STRONG>&nbsp;</DIV>
<DIV><STRONG><FONT face=3DArial size=3D2></FONT></STRONG>&nbsp;</DIV>
<DIV><STRONG><FONT face=3DArial size=3D2></FONT></STRONG>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>SignalActor </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<BLOCKQUOTE cite=3Dmid:favvfb$pmt$1@build.eclipse.org =
type=3D"cite"><FONT=20
face=3DArial size=3D2>
<DIV><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT face=3DArial=20
size=3D2>CDOSessionImpl.replaceConnector have the following: (maybe =
I need=20
more things...I`m not sure=20
=
)</FONT></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT></=
FONT></DIV><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
=
size=3D2></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT><=
/FONT></FONT>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT=20
=
size=3D2></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT><=
/FONT></FONT>&nbsp;</DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT=20
=
size=3D2></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT><=
/FONT></FONT>&nbsp;</DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT=20
face=3DArial>EventUtil.<I>removeListener</I>(</FONT></FONT ><FONT=20
face=3DArial><FONT color=3D#0000c0 size=3D2>channel</FONT><FONT =
size=3D2>,=20
</FONT><FONT color=3D#0000c0 =
size=3D2>channelListener</FONT></FONT><FONT=20
size=3D2><FONT=20
=
face=3DArial>);</FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT></=
FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT=20
=
size=3D2></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT><=
/FONT></FONT>&nbsp;</DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT=20
=
face=3DArial>setConnector(connectr);</FONT></FONT></FONT ></FONT></FONT></=
FONT></FONT></FONT></FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT=20
=
size=3D2></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT><=
/FONT></FONT>&nbsp;</DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT face=3DArial>OpenSessionRequest =
request =3D=20
</FONT></FONT><B><FONT color=3D#7f0055 size=3D2><FONT=20
face=3DArial>new</FONT></FONT></B><FONT face=3DArial><FONT size=3D2> =

OpenSessionRequest(</FONT><FONT color=3D#0000c0 =
size=3D2>channel</FONT><FONT=20
size=3D2>, </FONT><FONT color=3D#0000c0 =
size=3D2>repositoryName</FONT></FONT><FONT=20
size=3D2><FONT=20
=
face=3DArial>);</FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT></=
FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT face=3DArial>OpenSessionResult result =
=3D=20
=
request.send();</FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT></=
FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT face=3DArial color=3D#0000c0=20
size=3D2>sessionID</FONT><FONT size=3D2><FONT face=3DArial> =3D=20
=
result.getSessionID();</FONT></FONT></FONT></FONT></FONT ></FONT></FONT></=
FONT></FONT></FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT face=3DArial><FONT =
color=3D#0000c0=20
size=3D2>repositoryUUID</FONT><FONT size=3D2> =3D=20
=
result.getRepositoryUUID();</FONT></FONT></FONT></FONT></FONT ></FONT></FO=
NT></FONT></FONT></FONT></FONT></FONT></FONT></FONT></DIV ><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT=20
=
size=3D2></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT><=
/FONT></FONT></FONT>
<DIV><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT=20
=
size=3D2></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT><=
/FONT></FONT></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT=20
=
size=3D2></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT><=
/FONT></FONT></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT=20
=
size=3D2></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT><=
/FONT></FONT></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT face=3DArial size=3D2>I wasn`t sure if =
you would like=20
to put the fail-over closer to net4j or not..=20
=
<BR></FONT></FONT></FONT></FONT></FONT></FONT></FONT> </FONT></FONT></FONT=
></FONT></FONT></FONT></DIV></FONT></BLOCKQUOTE>If=20
that is possible (see above) it would of course be=20
better.<BR><BR>Cheers<BR>/Eike<BR><BR><BR></BLOCKQUOTE ></BODY></HTML>

------=_NextPart_000_010F_01C7E94D.A486F4D0--
Re: [CDO/NET4J][0.8.0] Failover mechanism [message #609570 is a reply to message #94645] Tue, 28 August 2007 19:54 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6632
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------020109070407060707000404
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Simon McDuff schrieb:
>
>
> "Eike Stepper" <stepper@sympedia.de <mailto:stepper@sympedia.de>>
> wrote in message news:fb0bva$odv$2@build.eclipse.org...
> Simon McDuff schrieb:
>> What do you think of the following :
>>
>> CDOSessionImpl could have a failOverStrategy. It just need to be
>> notify when this happen.
>> We will need to wrap every request like the following
>>
>>
>> return new FailOverRequest<CDORevisionImpl>(session)
>> {
>> public CDORevisionImpl sendRequest(int timeout) throws
>> TimeoutException, Exception
>> {
>> // Previous code
>> *return new LoadRevisionRequest(session.getChannel(),
>> id).send(timeout);*
>> }
>> }.send(1000);
>>
>>
>> *FailOverRequest.java*
>> **
>> public class FailOverRequest<REQUEST>
>> {
>>
>> Object session;
>> *public* FailOverRequest(SignalActor<RESULT> sending, Object session)
>> {
>> * this*.session = session;
>> }
>>
>> *public* REQUEST send(*int* timeout) *throws* Exception
>> {
>> TimeoutException timeOutException = *null*;
>> FailOverStrategy failOverStrategy = null;
>> * do*
>> {
>> * try*
>> {
>> * return* signalActor.send(timeout);
>> }
>> * catch*(TimeoutException exeption)
>> {
>> // Could use IManageContainer to get the strategy
>> if (failOverStrategy != null)
>> failOverStrategy =
>> FailOverStrategyFactory.create(repositoryName);
>>
>> IChannel channel=
>> failOverStrategy.requestNewConnector(session);
>>
>> * if* (channel== *null*)
>> * throw* exeption;
>>
>> signalActor.replaceChannel( channel );
>> }
>> } *while* (*true*);
>> }
>>
>>
>> }
>>
>>
>> I tried it with 2 servers... and it worked well when I load
>> objects !!!
> It is an interesting idea to wrap the requests!
> *[Simon] The advantage of wrapping it is the following. If the
> session change channel(between the first and second request)... it
> will change as well.*
> **
>
>
> Maybe it'd even be better if it was not necessary to subclass
> FailoverRequest for each signal to be wrapped.*[Agree.. but we
> will need to modify deeper]*
> I think that it could be possible to make the send() method of
> SignalActor protected and have it called by a generic method of an
> IFailOverStrategy..
> *[I don't understand . It is how it is designed ? *
> *Do you will subclass Signal<Actor> ?? Or SignalActor will know
> about failoverstrategy...]*
> Or *Signal<Actor> implements IFailOverStrategy ??*
>
I'd use a FailOverSignal wrapper similar to the one you proposed.
But I'd create an instance of it within the IFailOverStrategy and pass
the strategy in (instead of pulling it from a factory from within the
signal).
The session must be eliminated from the signal because its basically a
CDO dependency (although it avoids using a CDO interface).
The FailOverSignal should only communicate with the delegate signal and
the strategy.
The strategy should fire events when the FailOverSignal detects/finishes
a failOver situation.
The CDOSessionImpl could listen to these events.

> **
>
> IFailOverStrategy failOverStrategy =
> cdoSession.getFailOverStrategy();
> LoadRevisionRequest<CDORevisionImpl> request = new
> LoadRevisionRequest(session.getChannel(), id).send(timeout);
> long timeout = 2500;
> CDORevisionImpl result = failOverStrategy.send(request,
> timeout);
>
> The fail over strategy implementation could be dependent on
> CDOSession and react for example on the deactivation of the
> IChannel (due to server or network failure).
> What do you think?
> *[Simon] FailOverStrategy will ask for another channel... and the
> Signal<Actor> will change it. Signal<Actor> need to be able to
> change channel right ?*
>
> *[Simon] React on a desactivation of a IChannel... yes but it will
> need to differentiate between when I close the connection and when
> the network has errors. Also CDOSession should not fireEvent
> based on a fail-over... since the lifecycle of CDOSession is not
> desactivate. Right ?*
> *Maybe we should react on another event ... like TimeOutEvent... *
> **
> **
> **
>
>
>
>
> SignalActor
>
>
>
>> CDOSessionImpl.replaceConnector have the following: (maybe I need
>> more things...I`m not sure )
>>
>>
>> EventUtil./removeListener/(channel, channelListener);
>>
>> setConnector(connectr);
>>
>> OpenSessionRequest request = *new* OpenSessionRequest(channel,
>> repositoryName);
>> OpenSessionResult result = request.send();
>> sessionID = result.getSessionID();
>> repositoryUUID = result.getRepositoryUUID();
>>
>>
>>
>> I wasn`t sure if you would like to put the fail-over closer to
>> net4j or not..
> If that is possible (see above) it would of course be better.
>
> Cheers
> /Eike
>
>

--------------020109070407060707000404
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Simon McDuff schrieb:
<blockquote cite="mid:fb14gi$4np$1@build.eclipse.org" type="cite">
<meta http-equiv="Content-Type"
content="text/html;charset=ISO-8859-15">
<meta content="MSHTML 6.00.2900.3157" name="GENERATOR">
<div>


Re: [CDO/NET4J][0.8.0] Failover mechanism [message #609572 is a reply to message #94723] Tue, 28 August 2007 20:32 Go to previous message
Simon Mc Duff is currently offline Simon Mc DuffFriend
Messages: 596
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.

------=_NextPart_000_01F5_01C7E990.FDB357E0
Content-Type: text/plain;
charset="ISO-8859-15"
Content-Transfer-Encoding: quoted-printable

Perfect.. so we agree on a design!! :-)

Did you already did it ? Or I can do it and send you the patch ....




"Eike Stepper" <stepper@sympedia.de> wrote in message =
news:fb1uh6$36j$1@build.eclipse.org...
Simon McDuff schrieb:=20

"Eike Stepper" <stepper@sympedia.de> wrote in message =
news:fb0bva$odv$2@build.eclipse.org...
Simon McDuff schrieb:=20
What do you think of the following :

CDOSessionImpl could have a failOverStrategy. It just need to be =
notify when this happen.
We will need to wrap every request like the following

=20
return new FailOverRequest<CDORevisionImpl>(session)
{
public CDORevisionImpl sendRequest(int timeout) throws =
TimeoutException, Exception
{
// Previous code
return new LoadRevisionRequest(session.getChannel(), =
id).send(timeout);
}
}.send(1000);


FailOverRequest.java

public class FailOverRequest<REQUEST>
{

Object session;
public FailOverRequest(SignalActor<RESULT> sending, Object =
session)
{
this.session =3D session;
}

public REQUEST send(int timeout) throws Exception
{
TimeoutException timeOutException =3D null;
FailOverStrategy failOverStrategy =3D null;
do
{
try
{
return signalActor.send(timeout);
}
catch(TimeoutException exeption)
{
// Could use IManageContainer to get the strategy
if (failOverStrategy !=3D null)
failOverStrategy =3D =
FailOverStrategyFactory.create(repositoryName);

IChannel channel=3D =
failOverStrategy.requestNewConnector(session);

if (channel=3D=3D null)
throw exeption;

signalActor.replaceChannel( channel );=20
}
} while (true);
}


}


I tried it with 2 servers... and it worked well when I load =
objects !!!
It is an interesting idea to wrap the requests!
[Simon] The advantage of wrapping it is the following. If the =
session change channel(between the first and second request)... it will =
change as well.

Maybe it'd even be better if it was not necessary to subclass =
FailoverRequest for each signal to be wrapped.[Agree.. but we will need =
to modify deeper]
I think that it could be possible to make the send() method of =
SignalActor protected and have it called by a generic method of an =
IFailOverStrategy..
[I don't understand . It is how it is designed ?=20
Do you will subclass Signal<Actor> ?? Or SignalActor will know =
about failoverstrategy...]
Or Signal<Actor> implements IFailOverStrategy ??
I'd use a FailOverSignal wrapper similar to the one you proposed.
But I'd create an instance of it within the IFailOverStrategy and pass =
the strategy in (instead of pulling it from a factory from within the =
signal).
The session must be eliminated from the signal because its basically a =
CDO dependency (although it avoids using a CDO interface).
The FailOverSignal should only communicate with the delegate signal =
and the strategy.
The strategy should fire events when the FailOverSignal =
detects/finishes a failOver situation.
The CDOSessionImpl could listen to these events.




IFailOverStrategy failOverStrategy =3D =
cdoSession.getFailOverStrategy();
LoadRevisionRequest<CDORevisionImpl> request =3D new =
LoadRevisionRequest(session.getChannel(), id).send(timeout);
long timeout =3D 2500;
CDORevisionImpl result =3D failOverStrategy.send(request, =
timeout);

The fail over strategy implementation could be dependent on =
CDOSession and react for example on the deactivation of the IChannel =
(due to server or network failure).
What do you think?
[Simon] FailOverStrategy will ask for another channel... and the =
Signal<Actor> will change it. Signal<Actor> need to be able to change =
channel right ?
[Simon] React on a desactivation of a IChannel... yes but it will =
need to differentiate between when I close the connection and when the =
network has errors. Also CDOSession should not fireEvent based on a =
fail-over... since the lifecycle of CDOSession is not desactivate. Right =
?
Maybe we should react on another event ... like TimeOutEvent...=20







SignalActor=20



CDOSessionImpl.replaceConnector have the following: (maybe I =
need more things...I`m not sure )


EventUtil.removeListener(channel, channelListener);

setConnector(connectr);

OpenSessionRequest request =3D new OpenSessionRequest(channel, =
repositoryName);
OpenSessionResult result =3D request.send();
sessionID =3D result.getSessionID();
repositoryUUID =3D result.getRepositoryUUID();



I wasn`t sure if you would like to put the fail-over closer to =
net4j or not..=20

If that is possible (see above) it would of course be better.

Cheers
/Eike



------=_NextPart_000_01F5_01C7E990.FDB357E0
Content-Type: text/html;
charset="ISO-8859-15"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type =
content=3Dtext/html;charset=3DISO-8859-15>
<META content=3D"MSHTML 6.00.2900.3157" name=3DGENERATOR></HEAD>
<BODY text=3D#000000 bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Perfect.. so we agree on a design!!=20
:-)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Did you already did it ? Or I can do it =
and send=20
you the patch ....</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Eike Stepper" &lt;<A=20
href=3D"mailto:stepper@sympedia.de">stepper@sympedia.de</A>&gt; wrote =
in message=20
<A=20
=
href=3D"news:fb1uh6$36j$1@build.eclipse.org">news:fb1uh6$36j$1@build.ecli=
pse.org</A>...</DIV>Simon=20
McDuff schrieb:=20
<BLOCKQUOTE cite=3Dmid:fb14gi$4np$1@build.eclipse.org type=3D"cite">
<META content=3D"MSHTML 6.00.2900.3157" name=3DGENERATOR>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Eike Stepper" &lt;<A href=3D"mailto:stepper@sympedia.de"=20
moz-do-not-send=3D"true">stepper@sympedia.de</A>&gt; wrote in =
message <A=20
href=3D"news:fb0bva$odv$2@build.eclipse.org"=20
=
moz-do-not-send=3D"true">news:fb0bva$odv$2@build.eclipse.org</A>...</DIV>=
Simon=20
McDuff schrieb:=20
<BLOCKQUOTE cite=3Dmid:favvfb$pmt$1@build.eclipse.org =
type=3D"cite">
<META content=3D"MSHTML 6.00.6000.16525" name=3DGENERATOR>
<STYLE></STYLE>

<DIV><FONT face=3DArial size=3D2>What do you think of the =
following=20
:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>CDOSessionImpl could have a=20
failOverStrategy. It just need to be notify when this=20
happen.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>We will need to wrap every =
request like the=20
following</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
</FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>return new=20
FailOverRequest&lt;CDORevisionImpl&gt;(session)</FONT ></DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>{</FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
public=20
CDORevisionImpl sendRequest(int timeout) throws =
TimeoutException,=20
Exception</FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =

{</FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =

&nbsp;&nbsp;&nbsp; // Previous code</FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =

&nbsp;&nbsp;&nbsp; <STRONG>return new=20
LoadRevisionRequest(session.getChannel(),=20
id).send(timeout);</STRONG></FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =

}</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>}.send(1000);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial=20
size=3D2><STRONG>FailOverRequest.java</STRONG></FONT></DIV >
<DIV><STRONG></STRONG>&nbsp;</DIV><FONT face=3DArial size=3D2>
<DIV align=3Dleft><FONT color=3D#7f0055 size=3D2><FONT=20
color=3D#000000>public</FONT></FONT><FONT =
size=3D2>&nbsp;</FONT><FONT=20
size=3D2>class</FONT><FONT size=3D2>=20
FailOverRequest&lt;REQUEST&gt;</FONT></DIV>
<DIV align=3Dleft><FONT size=3D2>{</FONT></DIV>
<DIV align=3Dleft>&nbsp;</DIV>
<DIV align=3Dleft><FONT size=3D2><FONT=20
color=3D#0000c0>Object</FONT>&nbsp;</FONT><FONT color=3D#0000c0=20
size=3D2>session</FONT><FONT size=3D2>;</FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><B><FONT color=3D#7f0055=20
size=3D2>public</FONT></B><FONT size=3D2>=20
FailOverRequest(SignalActor&lt;RESULT&gt; sending, Object=20
session)</FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT =
size=3D2>{</FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><B><FONT =
color=3D#7f0055=20
size=3D2>&nbsp;&nbsp;&nbsp; this</FONT></B><FONT =
size=3D2>.</FONT><FONT=20
color=3D#0000c0 size=3D2>session</FONT><FONT size=3D2> =3D=20
session;</FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT=20
size=3D2>}</FONT></FONT></FONT></DIV>
<DIV align=3Dleft>&nbsp;</DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><B><FONT=20
color=3D#7f0055 size=3D2>public</FONT></B><FONT size=3D2> =
REQUEST=20
send(</FONT><B><FONT color=3D#7f0055 =
size=3D2>int</FONT></B><FONT size=3D2>=20
timeout) </FONT><B><FONT color=3D#7f0055 =
size=3D2>throws</FONT></B><FONT=20
size=3D2> Exception</FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2>{</FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2>&nbsp;&nbsp;&nbsp; TimeoutException timeOutException =
=3D=20
</FONT><B><FONT color=3D#7f0055 size=3D2>null</FONT></B><FONT=20
size=3D2>;</FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2>&nbsp;&nbsp;&nbsp; FailOverStrategy failOverStrategy =
=3D=20
null;</FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><B><FONT color=3D#7f0055 size=3D2>&nbsp;&nbsp;&nbsp;=20
do</FONT></B></FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2>&nbsp;&nbsp;&nbsp;=20
{</FONT></FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><B><FONT color=3D#7f0055 =
size=3D2>&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp;=20
try</FONT></B></FONT></FONT></FONT></FONT></FONT></DIV >
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT =
size=3D2> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =20
{</FONT></FONT></FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><B><FONT color=3D#7f0055=20
size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&nbsp;=20
return</FONT></B><FONT size=3D2>=20
=
signalActor.send(timeout);</FONT></FONT></FONT></FONT></FONT ></FONT></FON=
T></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2>&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp;=20
}</FONT></FONT></FONT></FONT></FONT></FONT></FONT></DIV >
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><B><FONT =
color=3D#7f0055=20
size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
catch</FONT></B><FONT=20
size=3D2>(TimeoutException=20
=
exeption)</FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT=20
size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
{</FONT></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
=
size=3D2> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;=20
// Could use IManageContainer to get the=20
=
strategy</FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT></=
DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT=20
size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp; if=20
(failOverStrategy&nbsp; !=3D=20
=
null)</FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT=20
size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; failOverStrategy =3D=20
FailOverStrategyFactory.create(<FONT color=3D#0000c0 =
size=3D2><FONT=20
=
color=3D#000000>repositoryName</FONT></FONT>);</FONT></FONT ></FONT></FONT=
></FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft>&nbsp;</DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT=20
=
size=3D2> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;IChannel=20
channel=3D failOverStrategy.requestNewConnector(<FONT=20
size=3D2>session</FONT><FONT=20
=
size=3D2>);</FONT></FONT></FONT></FONT></FONT></FONT> </FONT></FONT></FONT=
></DIV>
<DIV align=3Dleft>&nbsp;</DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><B><FONT=20
color=3D#7f0055=20
=
size=3D2> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;if</FONT></B><FONT=20
size=3D2> (channel=3D=3D </FONT><B><FONT color=3D#7f0055=20
size=3D2>null</FONT></B><FONT=20
=
size=3D2>)</FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT>=
</DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><B><FONT color=3D#7f0055 size=3D2>&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; throw</FONT></B><FONT =
size=3D2>=20
=
exeption;</FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT><=
/FONT></DIV>
<DIV align=3Dleft>&nbsp;</DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT color=3D#0000c0=20
=
size=3D2> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;=20
<FONT color=3D#000000>signalActor.</FONT></FONT><FONT=20
size=3D2>replaceChannel( channel );=20
=
</FONT></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT></F=
ONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT=20
=
size=3D2> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;} </FONT></FONT><=
/FONT></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2>&nbsp;&nbsp;&nbsp; } =
</FONT><B><FONT=20
color=3D#7f0055 size=3D2>while</FONT></B><FONT size=3D2> =
(</FONT><B><FONT=20
color=3D#7f0055 size=3D2>true</FONT></B><FONT=20
=
size=3D2>);</FONT></FONT></FONT></FONT></FONT></FONT> </FONT></FONT></FONT=
></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT=20
=
size=3D2>}</FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT>=
</FONT></FONT></DIV>
<DIV align=3Dleft>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT=20
=
size=3D2>}</FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT>=
</FONT></FONT></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT face=3DArial size=3D2>I tried it with 2 =
servers... and it=20
worked well when I load objects=20
=
!!!</FONT></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT>=
</FONT></DIV></FONT></BLOCKQUOTE>
<DIV>It is an interesting idea to wrap the requests!</DIV>
<DIV><FONT face=3DArial size=3D2><STRONG>[Simon] The advantage of =
wrapping=20
it&nbsp;is the following. If the session change channel(between =
the first=20
and second request)... it will change as=20
well.</STRONG></FONT></DIV><STRONG></STRONG></BLOCKQUOTE >
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px">
<DIV><BR>Maybe it'd even be better if it was not necessary to =
subclass=20
FailoverRequest for each signal to be wrapped.<STRONG>[Agree.. but =
we will=20
need to modify deeper]</STRONG><BR>I think that it could be =
possible to=20
make the send() method of SignalActor protected and have it called =
by a=20
generic method of an IFailOverStrategy..</DIV>
<DIV><FONT face=3DArial size=3D2><STRONG>[I don't =
understand&nbsp;. It is how=20
it is designed ?&nbsp;</STRONG></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><STRONG>Do you will subclass=20
Signal&lt;Actor&gt; ?? Or SignalActor will know=20
about&nbsp;failoverstrategy...]</STRONG></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Or =
<STRONG>Signal&lt;Actor&gt;&nbsp;=20
implements IFailOverStrategy=20
??</STRONG></FONT></DIV></BLOCKQUOTE></BLOCKQUOTE>I'd use a =
FailOverSignal=20
wrapper similar to the one you proposed.<BR>But I'd create an instance =
of it=20
within the IFailOverStrategy and pass the strategy in (instead of =
pulling it=20
from a factory from within the signal).<BR>The session must be =
eliminated from=20
the signal because its basically a CDO dependency (although it avoids =
using a=20
CDO interface).<BR>The FailOverSignal should only communicate with the =

delegate signal and the strategy.<BR>The strategy should fire events =
when the=20
FailOverSignal detects/finishes a failOver situation.<BR>The =
CDOSessionImpl=20
could listen to these events.<BR><BR>
<BLOCKQUOTE cite=3Dmid:fb14gi$4np$1@build.eclipse.org type=3D"cite">
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px">
<DIV><STRONG></STRONG><FONT size=3D2><BR></FONT><FONT =
face=3DArial><BR><FONT=20
size=3D2> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; =
IFailOverStrategy=20
failOverStrategy =3D =
cdoSession.getFailOverStrategy();<BR>&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp;&nbsp; =
LoadRevisionRequest&lt;CDORevisionImpl&gt;=20
request =3D new LoadRevisionRequest(session.getChannel(),=20
id).send(timeout);<BR>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; long =
timeout =3D=20
2500;<BR>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; =
CDORevisionImpl&nbsp;=20
result =3D failOverStrategy.send(request, =
timeout);<BR></FONT></FONT><BR>The=20
fail over strategy implementation could be dependent on CDOSession =
and=20
react for example on the deactivation of the IChannel (due to =
server or=20
network failure).<BR>What do you think?<BR><FONT size=3D2><FONT=20
face=3DArial><STRONG>[Simon] FailOverStrategy will ask for another =

channel... and the Signal&lt;Actor&gt; will change it. =
Signal&lt;Actor&gt;=20
need to be able to change channel right=20
?</STRONG></FONT></FONT></DIV></BLOCKQUOTE>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px">
<DIV><STRONG><FONT face=3DArial size=3D2>[Simon] React on a =
desactivation of a=20
IChannel... yes but it will need to differentiate between when I =
close the=20
connection and when the network has errors.&nbsp; Also CDOSession =
should=20
not fireEvent based on a fail-over... since the lifecycle of =
CDOSession is=20
not desactivate. Right ?</FONT></STRONG></DIV>
<DIV><STRONG><FONT face=3DArial size=3D2>Maybe we should react on =
another=20
event ... like TimeOutEvent... </FONT></STRONG></DIV>
<DIV><STRONG></STRONG>&nbsp;</DIV>
<DIV><STRONG></STRONG>&nbsp;</DIV>
<DIV><STRONG></STRONG>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>SignalActor </FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE cite=3Dmid:favvfb$pmt$1@build.eclipse.org =
type=3D"cite"><FONT=20
face=3DArial size=3D2>
<DIV><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT face=3DArial =
size=3D2>CDOSessionImpl.replaceConnector have the=20
following: (maybe I need more things...I`m not sure=20
=
)</FONT></FONT></FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT></=
FONT></DIV>
<DIV align=3Dleft>&nbsp;</DIV>
<DIV align=3Dleft>&nbsp;</DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT=20
face=3DArial>EventUtil.<I>removeListener</I>(</FONT></FONT ><FONT =

face=3DArial><FONT color=3D#0000c0 size=3D2>channel</FONT><FONT =
size=3D2>,=20
</FONT><FONT color=3D#0000c0 =
size=3D2>channelListener</FONT></FONT><FONT=20
size=3D2><FONT=20
=
face=3DArial>);</FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT></=
FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft>&nbsp;</DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT=20
=
face=3DArial>setConnector(connectr);</FONT></FONT></FONT ></FONT></FONT></=
FONT></FONT></FONT></FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft>&nbsp;</DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT =
face=3DArial>OpenSessionRequest=20
request =3D </FONT></FONT><B><FONT color=3D#7f0055 =
size=3D2><FONT=20
face=3DArial>new</FONT></FONT></B><FONT face=3DArial><FONT =
size=3D2>=20
OpenSessionRequest(</FONT><FONT color=3D#0000c0 =
size=3D2>channel</FONT><FONT=20
size=3D2>, </FONT><FONT color=3D#0000c0=20
size=3D2>repositoryName</FONT></FONT><FONT size=3D2><FONT=20
=
face=3DArial>);</FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT></=
FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT =
face=3DArial>OpenSessionResult=20
result =3D=20
=
request.send();</FONT></FONT></FONT></FONT></FONT></FONT ></FONT></FONT></=
FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT face=3DArial =
color=3D#0000c0=20
size=3D2>sessionID</FONT><FONT size=3D2><FONT face=3DArial> =3D=20
=
result.getSessionID();</FONT></FONT></FONT></FONT></FONT ></FONT></FONT></=
FONT></FONT></FONT></FONT></FONT></FONT></DIV>
<DIV align=3Dleft><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
face=3DArial><FONT=20
color=3D#0000c0 size=3D2>repositoryUUID</FONT><FONT size=3D2> =
=3D=20
=
result.getRepositoryUUID();</FONT></FONT></FONT></FONT></FONT ></FONT></FO=
NT></FONT></FONT></FONT></FONT></FONT></FONT></FONT></DIV >
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT size=3D2><FONT =
size=3D2><FONT=20
size=3D2><FONT size=3D2><FONT size=3D2><FONT face=3DArial =
size=3D2>I wasn`t sure=20
if you would like to put the fail-over closer to net4j or not..=20
=
<BR></FONT></FONT></FONT></FONT></FONT></FONT></FONT> </FONT></FONT></FONT=
></FONT></FONT></FONT></DIV></FONT></BLOCKQUOTE>If=20
that is possible (see above) it would of course be=20
=
better.<BR><BR>Cheers<BR>/Eike<BR><BR><BR></BLOCKQUOTE ></BLOCKQUOTE></BLO=
CKQUOTE></BODY></HTML>

------=_NextPart_000_01F5_01C7E990.FDB357E0--
Re: [CDO/NET4J][0.8.0] Failover mechanism [message #609576 is a reply to message #94758] Wed, 29 August 2007 06:38 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6632
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------090906030801030003040504
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Simon McDuff schrieb:
> Perfect.. so we agree on a design!! :-)
>
> Did you already did it ? Or I can do it and send you the patch ....
I'll give it a try ;-)

Cheers
/Eike



--------------090906030801030003040504
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Simon McDuff schrieb:
<blockquote cite="mid:fb20of$7bt$1@build.eclipse.org" type="cite">
<meta http-equiv="Content-Type"
content="text/html;charset=ISO-8859-15">
<meta content="MSHTML 6.00.2900.3157" name="GENERATOR">
<div><font face="Arial" size="2">Perfect.. so we agree on a design!!
:-)</font></div>
<div>


Previous Topic:[CDO] JPA
Next Topic:Persist EObject from BPEL20.XSD
Goto Forum:
  


Current Time: Sat Aug 20 06:36:44 GMT 2022

Powered by FUDForum. Page generated in 0.02794 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top