Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » eAdapter Notifications Batched ?
eAdapter Notifications Batched ? [message #420134] Wed, 18 June 2008 17:55 Go to next message
Alan is currently offline AlanFriend
Messages: 44
Registered: July 2009
Member
Hello all,

I am having a problem with notifications in EMF.
Basically I have a situation where all the objects in a model may be being
listened to by any number of others objects.
I have a transaction where I delete a number of these objects.
A notification is sent every time I delete an individual object but this is
causing a performance problem.
What I was wondering is if there is a way to only send these notifications
when this transaction is committed ?

thanks.
Re: eAdapter Notifications Batched ? [message #420135 is a reply to message #420134] Wed, 18 June 2008 18:04 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.zeligsoft.com

--=-lrSKAcsCRhyhyr+M0tYh
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi, Alan,

That is exactly the purpose of the ResourceSetListener interface. Have
a look at its documentation in Javadoc and the EMF Model Transaction
Developer Guide in the SDK's on-line help.

An additional benefit of this transactional style of listening is that
you won't be notified of any changes in the event that they are rolled
back by the transaction.

HTH,

Christian


On Wed, 2008-06-18 at 18:55 +0100, Alan wrote:

> Hello all,
>
> I am having a problem with notifications in EMF.
> Basically I have a situation where all the objects in a model may be being
> listened to by any number of others objects.
> I have a transaction where I delete a number of these objects.
> A notification is sent every time I delete an individual object but this is
> causing a performance problem.
> What I was wondering is if there is a way to only send these notifications
> when this transaction is committed ?
>
> thanks.
>
>

--=-lrSKAcsCRhyhyr+M0tYh
Content-Type: text/html; charset=utf-8

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.16.0">
</HEAD>
<BODY>
Hi, Alan,<BR>
<BR>
That is exactly the purpose of the ResourceSetListener interface.&nbsp; Have a look at its documentation in Javadoc and the EMF Model Transaction Developer Guide in the SDK's on-line help.<BR>
<BR>
An additional benefit of this transactional style of listening is that you won't be notified of any changes in the event that they are rolled back by the transaction.<BR>
<BR>
HTH,<BR>
<BR>
Christian<BR>
<BR>
<BR>
On Wed, 2008-06-18 at 18:55 +0100, Alan wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Hello all,</FONT>

<FONT COLOR="#000000">I am having a problem with notifications in EMF.</FONT>
<FONT COLOR="#000000">Basically I have a situation where all the objects in a model may be being </FONT>
<FONT COLOR="#000000">listened to by any number of others objects.</FONT>
<FONT COLOR="#000000">I have a transaction where I delete a number of these objects.</FONT>
<FONT COLOR="#000000">A notification is sent every time I delete an individual object but this is </FONT>
<FONT COLOR="#000000">causing a performance problem.</FONT>
<FONT COLOR="#000000">What I was wondering is if there is a way to only send these notifications </FONT>
<FONT COLOR="#000000">when this transaction is committed ?</FONT>

<FONT COLOR="#000000">thanks. </FONT>


</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>

--=-lrSKAcsCRhyhyr+M0tYh--
Re: eAdapter Notifications Batched ? [message #420165 is a reply to message #420135] Thu, 19 June 2008 17:18 Go to previous messageGo to next message
Alan is currently offline AlanFriend
Messages: 44
Registered: July 2009
Member
This is a multi-part message in MIME format.

------=_NextPart_000_000D_01C8D238.CF689BC0
Content-Type: text/plain;
charset="utf-8"
Content-Transfer-Encoding: quoted-printable

Hi Christian,

I followed up on that and it looks promising.
Basically what I have is a central controller (for my central model =
which you may remember from previous posts about ChangeRecorder and =
ChangeDescs etc)
Anyway this controller listens for changes and sends them out.
So I have a listener that is listening to the resource set filtered to =
only the central model changes.
Then I run a command which calls the controller and the controller =
reacts by sending out these notifications.

I am having one issue though. When I delete an object from a GMF diagram =
everything underneath is being deleted correctly but the view object =
does not go away until I open another editor and then flick back to the =
first one.
I know this is not the GMF forum but I was wondering if you have any =
idea what is going on here ?

thanks,
Alan.

"Christian W. Damus" <cdamus@zeligsoft.com> wrote in message =
news:1213812277.6416.29.camel@cwdlappy...
Hi, Alan,

That is exactly the purpose of the ResourceSetListener interface. =
Have a look at its documentation in Javadoc and the EMF Model =
Transaction Developer Guide in the SDK's on-line help.

An additional benefit of this transactional style of listening is that =
you won't be notified of any changes in the event that they are rolled =
back by the transaction.

HTH,

Christian


On Wed, 2008-06-18 at 18:55 +0100, Alan wrote:=20
Hello all,

I am having a problem with notifications in EMF.
Basically I have a situation where all the objects in a model may be =
being=20
listened to by any number of others objects.
I have a transaction where I delete a number of these objects.
A notification is sent every time I delete an individual object but this =
is=20
causing a performance problem.
What I was wondering is if there is a way to only send these =
notifications=20
when this transaction is committed ?

thanks.=20



------=_NextPart_000_000D_01C8D238.CF689BC0
Content-Type: text/html;
charset="utf-8"
Content-Transfer-Encoding: quoted-printable

=EF=BB=BF<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; CHARSET=3DUTF-8">
<META content=3D"MSHTML 6.00.6000.16640" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi Christian,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I followed up on that and it looks=20
promising.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Basically what I have is a central =
controller (for=20
my central model which you may remember from previous posts about =
ChangeRecorder=20
and ChangeDescs etc)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Anyway this controller listens for =
changes and=20
sends them out.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>So I have a listener that is listening =
to the=20
resource set filtered to only the central model changes.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Then I run a command which calls the =
controller and=20
the controller reacts by sending out these notifications.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I am having one issue though. When I =
delete an=20
object from a GMF diagram everything underneath is being deleted =
correctly but=20
the view object does not go away until I open another editor and then =
flick back=20
to the first one.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I know this is not the GMF forum but I =
was=20
wondering if you have any idea what is going on here ?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>thanks,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Alan.</FONT></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>"Christian W. Damus" &lt;<A=20
href=3D"mailto:cdamus@zeligsoft.com">cdamus@zeligsoft.com</A>&gt; =
wrote in=20
message <A=20
=
href=3D"news:1213812277.6416.29.camel@cwdlappy">news:1213812277.6416.29.c=
amel@cwdlappy</A>...</DIV>Hi,=20
Alan,<BR><BR>That is exactly the purpose of the ResourceSetListener=20
interface.&nbsp; Have a look at its documentation in Javadoc and the =
EMF Model=20
Transaction Developer Guide in the SDK's on-line help.<BR><BR>An =
additional=20
benefit of this transactional style of listening is that you won't be =
notified=20
of any changes in the event that they are rolled back by the=20
transaction.<BR><BR>HTH,<BR><BR>Christian<BR><BR><BR >On Wed, =
2008-06-18 at=20
18:55 +0100, Alan wrote:=20
<BLOCKQUOTE TYPE=3D"CITE"><PRE><FONT color=3D#000000>Hello all,</FONT>

<FONT color=3D#000000>I am having a problem with notifications in =
EMF.</FONT>
<FONT color=3D#000000>Basically I have a situation where all the objects =
in a model may be being </FONT>
<FONT color=3D#000000>listened to by any number of others =
objects.</FONT>
<FONT color=3D#000000>I have a transaction where I delete a number of =
these objects.</FONT>
<FONT color=3D#000000>A notification is sent every time I delete an =
individual object but this is </FONT>
<FONT color=3D#000000>causing a performance problem.</FONT>
<FONT color=3D#000000>What I was wondering is if there is a way to only =
send these notifications </FONT>
<FONT color=3D#000000>when this transaction is committed ?</FONT>

<FONT color=3D#000000>thanks. </FONT>


</PRE></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_000D_01C8D238.CF689BC0--
Re: eAdapter Notifications Batched ? [message #420180 is a reply to message #420135] Fri, 20 June 2008 13:02 Go to previous messageGo to next message
Alan is currently offline AlanFriend
Messages: 44
Registered: July 2009
Member
This is a multi-part message in MIME format.

------=_NextPart_000_0010_01C8D2DE.515CD470
Content-Type: text/plain;
charset="utf-8"
Content-Transfer-Encoding: quoted-printable

Hi,

Is there a way to react to changes only once the transaction has =
committed ?
transactionAboutToCommit is before it commits obviously.
Also if this can be done will I still be able to write to model. (i.e. =
non-read-only transaction) ?

thanks


"Christian W. Damus" <cdamus@zeligsoft.com> wrote in message =
news:1213812277.6416.29.camel@cwdlappy...
Hi, Alan,

That is exactly the purpose of the ResourceSetListener interface. =
Have a look at its documentation in Javadoc and the EMF Model =
Transaction Developer Guide in the SDK's on-line help.

An additional benefit of this transactional style of listening is that =
you won't be notified of any changes in the event that they are rolled =
back by the transaction.

HTH,

Christian


On Wed, 2008-06-18 at 18:55 +0100, Alan wrote:=20
Hello all,

I am having a problem with notifications in EMF.
Basically I have a situation where all the objects in a model may be =
being=20
listened to by any number of others objects.
I have a transaction where I delete a number of these objects.
A notification is sent every time I delete an individual object but this =
is=20
causing a performance problem.
What I was wondering is if there is a way to only send these =
notifications=20
when this transaction is committed ?

thanks.=20



------=_NextPart_000_0010_01C8D2DE.515CD470
Content-Type: text/html;
charset="utf-8"
Content-Transfer-Encoding: quoted-printable

=EF=BB=BF<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; CHARSET=3DUTF-8">
<META content=3D"MSHTML 6.00.6000.16640" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Is there a way to react to changes only =
once the=20
transaction has committed ?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>transactionAboutToCommit is before it =
commits=20
obviously.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Also if this can be done will I still =
be able to=20
write to model. (i.e. non-read-only transaction) ?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>thanks</FONT></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>"Christian W. Damus" &lt;<A=20
href=3D"mailto:cdamus@zeligsoft.com">cdamus@zeligsoft.com</A>&gt; =
wrote in=20
message <A=20
=
href=3D"news:1213812277.6416.29.camel@cwdlappy">news:1213812277.6416.29.c=
amel@cwdlappy</A>...</DIV>Hi,=20
Alan,<BR><BR>That is exactly the purpose of the ResourceSetListener=20
interface.&nbsp; Have a look at its documentation in Javadoc and the =
EMF Model=20
Transaction Developer Guide in the SDK's on-line help.<BR><BR>An =
additional=20
benefit of this transactional style of listening is that you won't be =
notified=20
of any changes in the event that they are rolled back by the=20
transaction.<BR><BR>HTH,<BR><BR>Christian<BR><BR><BR >On Wed, =
2008-06-18 at=20
18:55 +0100, Alan wrote:=20
<BLOCKQUOTE TYPE=3D"CITE"><PRE><FONT color=3D#000000>Hello all,</FONT>

<FONT color=3D#000000>I am having a problem with notifications in =
EMF.</FONT>
<FONT color=3D#000000>Basically I have a situation where all the objects =
in a model may be being </FONT>
<FONT color=3D#000000>listened to by any number of others =
objects.</FONT>
<FONT color=3D#000000>I have a transaction where I delete a number of =
these objects.</FONT>
<FONT color=3D#000000>A notification is sent every time I delete an =
individual object but this is </FONT>
<FONT color=3D#000000>causing a performance problem.</FONT>
<FONT color=3D#000000>What I was wondering is if there is a way to only =
send these notifications </FONT>
<FONT color=3D#000000>when this transaction is committed ?</FONT>

<FONT color=3D#000000>thanks. </FONT>


</PRE></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0010_01C8D2DE.515CD470--
Re: eAdapter Notifications Batched ? [message #420181 is a reply to message #420165] Fri, 20 June 2008 13:05 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.zeligsoft.com

--=-WwDUg9j8nLF5YLHoJFId
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi, Alan,

Good! I'm glad things are looking up.

Are you running a command within the context of a
ResourceSetListener::resourceSetChanged(...) invocation? You shouldn't
be able to do that, as listeners are invoked in read-only transactions.

I'm not sure about your GMF problem. AFAIK, the extensible "destroy"
command should already be advised with a command to destroy views of the
semantic element that is being destroyed. I'd start by looking for an
exception in an EditPart, which is causing the diagram views not to be
updated. Is this a canonical diagram? Probably best to follow up on
the GMF newsgroup.

cW

On Thu, 2008-06-19 at 18:18 +0100, Alan wrote:

> =EF=BB=BF=20
>=20
> Hi Christian,
> =20
> I followed up on that and it looks promising.
> Basically what I have is a central controller (for my central model
> which you may remember from previous posts about ChangeRecorder and
> ChangeDescs etc)
> Anyway this controller listens for changes and sends them out.
> So I have a listener that is listening to the resource set filtered to
> only the central model changes.
> Then I run a command which calls the controller and the controller
> reacts by sending out these notifications.
> =20
> I am having one issue though. When I delete an object from a GMF
> diagram everything underneath is being deleted correctly but the view
> object does not go away until I open another editor and then flick
> back to the first one.
> I know this is not the GMF forum but I was wondering if you have any
> idea what is going on here ?
> =20
> thanks,
> Alan.
> =20
> "Christian W. Damus" <cdamus@zeligsoft.com> wrote in message
> news:1213812277.6416.29.camel@cwdlappy...
> =20
> Hi, Alan,
> =20
> That is exactly the purpose of the ResourceSetListener
> interface. Have a look at its documentation in Javadoc and
> the EMF Model Transaction Developer Guide in the SDK's on-line
> help.
> =20
> An additional benefit of this transactional style of listening
> is that you won't be notified of any changes in the event that
> they are rolled back by the transaction.
> =20
> HTH,
> =20
> Christian
> =20
> =20
> On Wed, 2008-06-18 at 18:55 +0100, Alan wrote:=20
> =20
> > Hello all,
> >=20
> > I am having a problem with notifications in EMF.
> > Basically I have a situation where all the objects in a model m=
ay be being=20
> > listened to by any number of others objects.
> > I have a transaction where I delete a number of these objects.
> > A notification is sent every time I delete an individual object=
but this is=20
> > causing a performance problem.
> > What I was wondering is if there is a way to only send these no=
tifications=20
> > when this transaction is committed ?
> >=20
> > thanks.=20
> >=20
> >=20

--=-WwDUg9j8nLF5YLHoJFId
Content-Type: text/html; charset=utf-8

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.16.0">
</HEAD>
<BODY BGCOLOR="#ffffff">
Hi, Alan,<BR>
<BR>
Good!&nbsp; I'm glad things are looking up.<BR>
<BR>
Are you running a command within the context of a ResourceSetListener::resourceSetChanged(...) invocation?&nbsp; You shouldn't be able to do that, as listeners are invoked in read-only transactions.<BR>
<BR>
I'm not sure about your GMF problem.&nbsp; AFAIK, the extensible &quot;destroy&quot; command should already be advised with a command to destroy views of the semantic element that is being destroyed.&nbsp; I'd start by looking for an exception in an EditPart, which is causing the diagram views not to be updated.&nbsp; Is this a canonical diagram?&nbsp; Probably best to follow up on the GMF newsgroup.<BR>
<BR>
cW<BR>
<BR>
On Thu, 2008-06-19 at 18:18 +0100, Alan wrote:<BR>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000">&#65279; </FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT SIZE="2"><FONT COLOR="#000000">Hi Christian,</FONT></FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000">&nbsp;</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT SIZE="2"><FONT COLOR="#000000">I followed up on that and it looks promising.</FONT></FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT SIZE="2"><FONT COLOR="#000000">Basically what I have is a central controller (for my central model which you may remember from previous posts about ChangeRecorder and ChangeDescs etc)</FONT></FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT SIZE="2"><FONT COLOR="#000000">Anyway this controller listens for changes and sends them out.</FONT></FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT SIZE="2"><FONT COLOR="#000000">So I have a listener that is listening to the resource set filtered to only the central model changes.</FONT></FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT SIZE="2"><FONT COLOR="#000000">Then I run a command which calls the controller and the controller reacts by sending out these notifications.</FONT></FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000">&nbsp;</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT SIZE="2"><FONT COLOR="#000000">I am having one issue though. When I delete an object from a GMF diagram everything underneath is being deleted correctly but the view object does not go away until I open another editor and then flick back to the first one.</FONT></FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT SIZE="2"><FONT COLOR="#000000">I know this is not the GMF forum but I was wondering if you have any idea what is going on here ?</FONT></FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000">&nbsp;</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT SIZE="2"><FONT COLOR="#000000">thanks,</FONT></FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT SIZE="2"><FONT COLOR="#000000">Alan.</FONT></FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000">&nbsp;</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<BLOCKQUOTE>
<FONT COLOR="#000000">&quot;Christian W. Damus&quot; &lt;<A HREF="mailto:cdamus@zeligsoft.com">cdamus@zeligsoft.com</A>&gt; wrote in message <A HREF="news:1213812277.6416.29.camel@cwdlappy">news:1213812277.6416.29.camel@cwdlappy</A>...</FONT>
</BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<BLOCKQUOTE>
<FONT COLOR="#000000">Hi, Alan,</FONT><BR>
<BR>
<FONT COLOR="#000000">That is exactly the purpose of the ResourceSetListener interface.&nbsp; Have a look at its documentation in Javadoc and the EMF Model Transaction Developer Guide in the SDK's on-line help.</FONT><BR>
<BR>
<FONT COLOR="#000000">An additional benefit of this transactional style of listening is that you won't be notified of any changes in the event that they are rolled back by the transaction.</FONT><BR>
<BR>
<FONT COLOR="#000000">HTH,</FONT><BR>
<BR>
<FONT COLOR="#000000">Christian</FONT><BR>
<BR>
<BR>
<FONT COLOR="#000000">On Wed, 2008-06-18 at 18:55 +0100, Alan wrote: </FONT>
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Hello all,</FONT>

<FONT COLOR="#000000">I am having a problem with notifications in EMF.</FONT>
<FONT COLOR="#000000">Basically I have a situation where all the objects in a model may be being </FONT>
<FONT COLOR="#000000">listened to by any number of others objects.</FONT>
<FONT COLOR="#000000">I have a transaction where I delete a number of these objects.</FONT>
<FONT COLOR="#000000">A notification is sent every time I delete an individual object but this is </FONT>
<FONT COLOR="#000000">causing a performance problem.</FONT>
<FONT COLOR="#000000">What I was wondering is if there is a way to only send these notifications </FONT>
<FONT COLOR="#000000">when this transaction is committed ?</FONT>

<FONT COLOR="#000000">thanks. </FONT>


</PRE>
</BLOCKQUOTE>
</BLOCKQUOTE>
</BLOCKQUOTE>
</BODY>
</HTML>

--=-WwDUg9j8nLF5YLHoJFId--
Re: eAdapter Notifications Batched ? [message #420182 is a reply to message #420180] Fri, 20 June 2008 13:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.zeligsoft.com

--=-CG1EhRtlw+cCDlNX2egk
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi, Alan,

What you need is the resourceSetChanged() method of the
ResourceSetListener. It is triggered after changes have been
successfully committed by a transaction.

All listener call-backs are performed in a read-only transaction. This
ensures that no surprising new changes will occur during the processing
of change notifications, ensuring that all listeners get the same view
of the data. The transaction is a control freak! ;-)

If you do need to make further changes to the model concomitant to the
changes observed, that is exactly the purpose of the commands returned
by a pre-commit listener. Why would you want to make additional changes
in a new transaction, rather than piggy-backing on the one that is
committing?

Cheers,

Christian


On Fri, 2008-06-20 at 14:02 +0100, Alan wrote:

> =EF=BB=BF=20
>=20
> Hi,
> =20
> Is there a way to react to changes only once the transaction has
> committed ?
> transactionAboutToCommit is before it commits obviously.
> Also if this can be done will I still be able to write to model. (i.e.
> non-read-only transaction) ?
> =20
> thanks
> =20
> =20
> "Christian W. Damus" <cdamus@zeligsoft.com> wrote in message
> news:1213812277.6416.29.camel@cwdlappy...
> =20
> Hi, Alan,
> =20
> That is exactly the purpose of the ResourceSetListener
> interface. Have a look at its documentation in Javadoc and
> the EMF Model Transaction Developer Guide in the SDK's on-line
> help.
> =20
> An additional benefit of this transactional style of listening
> is that you won't be notified of any changes in the event that
> they are rolled back by the transaction.
> =20
> HTH,
> =20
> Christian
> =20
> =20
> On Wed, 2008-06-18 at 18:55 +0100, Alan wrote:=20
> =20
> > Hello all,
> >=20
> > I am having a problem with notifications in EMF.
> > Basically I have a situation where all the objects in a model m=
ay be being=20
> > listened to by any number of others objects.
> > I have a transaction where I delete a number of these objects.
> > A notification is sent every time I delete an individual object=
but this is=20
> > causing a performance problem.
> > What I was wondering is if there is a way to only send these no=
tifications=20
> > when this transaction is committed ?
> >=20
> > thanks.=20
> >=20
> >=20

--=-CG1EhRtlw+cCDlNX2egk
Content-Type: text/html; charset=utf-8

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.16.0">
</HEAD>
<BODY BGCOLOR="#ffffff">
Hi, Alan,<BR>
<BR>
What you need is the resourceSetChanged() method of the ResourceSetListener.&nbsp; It is triggered after changes have been successfully committed by a transaction.<BR>
<BR>
All listener call-backs are performed in a read-only transaction.&nbsp; This ensures that no surprising new changes will occur during the processing of change notifications, ensuring that all listeners get the same view of the data.&nbsp; The transaction is a control freak!&nbsp; ;-)<BR>
<BR>
If you do need to make further changes to the model concomitant to the changes observed, that is exactly the purpose of the commands returned by a pre-commit listener.&nbsp; Why would you want to make additional changes in a new transaction, rather than piggy-backing on the one that is committing?<BR>
<BR>
Cheers,<BR>
<BR>
Christian<BR>
<BR>
<BR>
On Fri, 2008-06-20 at 14:02 +0100, Alan wrote:<BR>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000">&#65279; </FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT SIZE="2"><FONT COLOR="#000000">Hi,</FONT></FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000">&nbsp;</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT SIZE="2"><FONT COLOR="#000000">Is there a way to react to changes only once the transaction has committed ?</FONT></FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT SIZE="2"><FONT COLOR="#000000">transactionAboutToCommit is before it commits obviously.</FONT></FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT SIZE="2"><FONT COLOR="#000000">Also if this can be done will I still be able to write to model. (i.e. non-read-only transaction) ?</FONT></FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000">&nbsp;</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT SIZE="2"><FONT COLOR="#000000">thanks</FONT></FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000">&nbsp;</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000">&nbsp;</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<BLOCKQUOTE>
<FONT COLOR="#000000">&quot;Christian W. Damus&quot; &lt;<A HREF="mailto:cdamus@zeligsoft.com">cdamus@zeligsoft.com</A>&gt; wrote in message <A HREF="news:1213812277.6416.29.camel@cwdlappy">news:1213812277.6416.29.camel@cwdlappy</A>...</FONT>
</BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<BLOCKQUOTE>
<FONT COLOR="#000000">Hi, Alan,</FONT><BR>
<BR>
<FONT COLOR="#000000">That is exactly the purpose of the ResourceSetListener interface.&nbsp; Have a look at its documentation in Javadoc and the EMF Model Transaction Developer Guide in the SDK's on-line help.</FONT><BR>
<BR>
<FONT COLOR="#000000">An additional benefit of this transactional style of listening is that you won't be notified of any changes in the event that they are rolled back by the transaction.</FONT><BR>
<BR>
<FONT COLOR="#000000">HTH,</FONT><BR>
<BR>
<FONT COLOR="#000000">Christian</FONT><BR>
<BR>
<BR>
<FONT COLOR="#000000">On Wed, 2008-06-18 at 18:55 +0100, Alan wrote: </FONT>
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Hello all,</FONT>

<FONT COLOR="#000000">I am having a problem with notifications in EMF.</FONT>
<FONT COLOR="#000000">Basically I have a situation where all the objects in a model may be being </FONT>
<FONT COLOR="#000000">listened to by any number of others objects.</FONT>
<FONT COLOR="#000000">I have a transaction where I delete a number of these objects.</FONT>
<FONT COLOR="#000000">A notification is sent every time I delete an individual object but this is </FONT>
<FONT COLOR="#000000">causing a performance problem.</FONT>
<FONT COLOR="#000000">What I was wondering is if there is a way to only send these notifications </FONT>
<FONT COLOR="#000000">when this transaction is committed ?</FONT>

<FONT COLOR="#000000">thanks. </FONT>


</PRE>
</BLOCKQUOTE>
</BLOCKQUOTE>
</BLOCKQUOTE>
</BODY>
</HTML>

--=-CG1EhRtlw+cCDlNX2egk--
Re: eAdapter Notifications Batched ? [message #420191 is a reply to message #420182] Fri, 20 June 2008 15:40 Go to previous messageGo to next message
Alan is currently offline AlanFriend
Messages: 44
Registered: July 2009
Member
This is a multi-part message in MIME format.

------=_NextPart_000_0013_01C8D2F4.69C85910
Content-Type: text/plain;
charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi Christian,

Basically changes to the shared model cause other models to react to the =
changes.
Maybe my motivation is performance. I don't want my action slowed up by =
other models reacting to the changes from it.
But perhaps there are other ways to solve this such as jobs, asynch =
threads etc ?

thanks
"Christian W. Damus" <cdamus@zeligsoft.com> wrote in message =
news:1213967822.6358.24.camel@cwdlappy...
Hi, Alan,

What you need is the resourceSetChanged() method of the =
ResourceSetListener. It is triggered after changes have been =
successfully committed by a transaction.

All listener call-backs are performed in a read-only transaction. =
This ensures that no surprising new changes will occur during the =
processing of change notifications, ensuring that all listeners get the =
same view of the data. The transaction is a control freak! ;-)

If you do need to make further changes to the model concomitant to the =
changes observed, that is exactly the purpose of the commands returned =
by a pre-commit listener. Why would you want to make additional changes =
in a new transaction, rather than piggy-backing on the one that is =
committing?

Cheers,

Christian


On Fri, 2008-06-20 at 14:02 +0100, Alan wrote:

=EF=BB=BF=20
Hi,=20
=20
Is there a way to react to changes only once the transaction has =
committed ?=20
transactionAboutToCommit is before it commits obviously.=20
Also if this can be done will I still be able to write to model. =
(i.e. non-read-only transaction) ?=20
=20
thanks=20
=20
=20
"Christian W. Damus" <cdamus@zeligsoft.com> wrote in message =
news:1213812277.6416.29.camel@cwdlappy...=20
Hi, Alan,

That is exactly the purpose of the ResourceSetListener interface. =
Have a look at its documentation in Javadoc and the EMF Model =
Transaction Developer Guide in the SDK's on-line help.

An additional benefit of this transactional style of listening is =
that you won't be notified of any changes in the event that they are =
rolled back by the transaction.

HTH,

Christian


On Wed, 2008-06-18 at 18:55 +0100, Alan wrote:=20
Hello all,

I am having a problem with notifications in EMF.
Basically I have a situation where all the objects in a model may be =
being=20
listened to by any number of others objects.
I have a transaction where I delete a number of these objects.
A notification is sent every time I delete an individual object but this =
is=20
causing a performance problem.
What I was wondering is if there is a way to only send these =
notifications=20
when this transaction is committed ?

thanks.=20



------=_NextPart_000_0013_01C8D2F4.69C85910
Content-Type: text/html;
charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

=EF=BB=BF<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; CHARSET=3DUTF-8">
<META content=3D"MSHTML 6.00.6000.16640" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi Christian,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Basically changes to the shared model =
cause other=20
models to react to the changes.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Maybe my motivation is performance. I =
don't want my=20
action slowed up by other models reacting to the changes from =
it.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>But perhaps there are other ways to =
solve this such=20
as jobs, asynch threads etc ?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>thanks</FONT></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>"Christian W. Damus" &lt;<A=20
href=3D"mailto:cdamus@zeligsoft.com">cdamus@zeligsoft.com</A>&gt; =
wrote in=20
message <A=20
=
href=3D"news:1213967822.6358.24.camel@cwdlappy">news:1213967822.6358.24.c=
amel@cwdlappy</A>...</DIV>Hi,=20
Alan,<BR><BR>What you need is the resourceSetChanged() method of the=20
ResourceSetListener.&nbsp; It is triggered after changes have been=20
successfully committed by a transaction.<BR><BR>All listener =
call-backs are=20
performed in a read-only transaction.&nbsp; This ensures that no =
surprising=20
new changes will occur during the processing of change notifications, =
ensuring=20
that all listeners get the same view of the data.&nbsp; The =
transaction is a=20
control freak!&nbsp; ;-)<BR><BR>If you do need to make further changes =
to the=20
model concomitant to the changes observed, that is exactly the purpose =
of the=20
commands returned by a pre-commit listener.&nbsp; Why would you want =
to make=20
additional changes in a new transaction, rather than piggy-backing on =
the one=20
that is committing?<BR><BR>Cheers,<BR><BR>Christian<BR><BR><BR >On Fri, =

2008-06-20 at 14:02 +0100, Alan wrote:<BR>
<BLOCKQUOTE TYPE=3D"CITE"><FONT color=3D#000000>=EF=BB=BF =
</FONT></BLOCKQUOTE>
<BLOCKQUOTE TYPE=3D"CITE"><FONT size=3D2><FONT =
color=3D#000000>Hi,</FONT></FONT>=20
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=3D"CITE"><FONT color=3D#000000></FONT> </BLOCKQUOTE>
<BLOCKQUOTE TYPE=3D"CITE"><FONT size=3D2><FONT color=3D#000000>Is =
there a way to=20
react to changes only once the transaction has committed =
?</FONT></FONT>=20
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=3D"CITE"><FONT size=3D2><FONT=20
color=3D#000000>transactionAboutToCommit is before it commits=20
obviously.</FONT></FONT> </BLOCKQUOTE>
<BLOCKQUOTE TYPE=3D"CITE"><FONT size=3D2><FONT color=3D#000000>Also if =
this can be=20
done will I still be able to write to model. (i.e. non-read-only=20
transaction) ?</FONT></FONT> </BLOCKQUOTE>
<BLOCKQUOTE TYPE=3D"CITE"><FONT color=3D#000000></FONT> </BLOCKQUOTE>
<BLOCKQUOTE TYPE=3D"CITE"><FONT size=3D2><FONT=20
color=3D#000000>thanks</FONT></FONT> </BLOCKQUOTE>
<BLOCKQUOTE TYPE=3D"CITE"><FONT color=3D#000000></FONT> </BLOCKQUOTE>
<BLOCKQUOTE TYPE=3D"CITE"><FONT color=3D#000000></FONT> </BLOCKQUOTE>
<BLOCKQUOTE TYPE=3D"CITE">
<BLOCKQUOTE><FONT color=3D#000000>"Christian W. Damus" &lt;<A=20
href=3D"mailto:cdamus@zeligsoft.com">cdamus@zeligsoft.com</A>&gt; =
wrote in=20
message <A=20
=
href=3D"news:1213812277.6416.29.camel@cwdlappy">news:1213812277.6416.29.c=
amel@cwdlappy</A>...</FONT>=20
</BLOCKQUOTE></BLOCKQUOTE>
<BLOCKQUOTE TYPE=3D"CITE">
<BLOCKQUOTE><FONT color=3D#000000>Hi, Alan,</FONT><BR><BR><FONT=20
color=3D#000000>That is exactly the purpose of the =
ResourceSetListener=20
interface.&nbsp; Have a look at its documentation in Javadoc and =
the EMF=20
Model Transaction Developer Guide in the SDK's on-line=20
help.</FONT><BR><BR><FONT color=3D#000000>An additional benefit of =
this=20
transactional style of listening is that you won't be notified of =
any=20
changes in the event that they are rolled back by the=20
transaction.</FONT><BR><BR><FONT =
color=3D#000000>HTH,</FONT><BR><BR><FONT=20
color=3D#000000>Christian</FONT><BR><BR><BR><FONT =
color=3D#000000>On Wed,=20
2008-06-18 at 18:55 +0100, Alan wrote: </FONT>
<BLOCKQUOTE TYPE=3D"CITE"><PRE><FONT color=3D#000000>Hello =
all,</FONT>

<FONT color=3D#000000>I am having a problem with notifications in =
EMF.</FONT>
<FONT color=3D#000000>Basically I have a situation where all the objects =
in a model may be being </FONT>
<FONT color=3D#000000>listened to by any number of others =
objects.</FONT>
<FONT color=3D#000000>I have a transaction where I delete a number of =
these objects.</FONT>
<FONT color=3D#000000>A notification is sent every time I delete an =
individual object but this is </FONT>
<FONT color=3D#000000>causing a performance problem.</FONT>
<FONT color=3D#000000>What I was wondering is if there is a way to only =
send these notifications </FONT>
<FONT color=3D#000000>when this transaction is committed ?</FONT>

<FONT color=3D#000000>thanks. </FONT>


</PRE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE ></BODY></HTML>

------=_NextPart_000_0013_01C8D2F4.69C85910--
Re: eAdapter Notifications Batched ? [message #420207 is a reply to message #420191] Sun, 22 June 2008 02:03 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.zeligsoft.com

--=-d7GjS77wSHig/exICjLQ
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi, Alan,

I guess the performance will depend on just how many changes your action
is performing in the one model, and how many concomitant changes it will
trigger in how many other models. And, of course, these other models
could be remote ... I don't know your situation. If you want to trigger
changes from the post-commit listener, then you will have to do it
asynchronously, because the listener is called in a read-only
transaction and simply will not be able to perform any changes
synchronously.

However, I would be worried about undo/redo. Pre-commit commands are
automatically captured by the transaction for undo/redo. In your case,
though, you will have to rely on undo of the original action triggering
compensating changes in the other models. The problem is how to manage
the undo history. You don't want to asynchronously execute a command on
the stack because it should not appear as a distinct command that can be
undone (I expect this would surprise your users). However, if the other
models are editable, then their undo/redo histories would be corrupted
if these listener-changes are not captured on the command stack, because
subsequent changes will depend on them.

cW


On Fri, 2008-06-20 at 16:40 +0100, Alan wrote:

> =EF=BB=BF=20
>=20
> Hi Christian,
> =20
> Basically changes to the shared model cause other models to react to
> the changes.
> Maybe my motivation is performance. I don't want my action slowed up
> by other models reacting to the changes from it.
> But perhaps there are other ways to solve this such as jobs, asynch
> threads etc ?
> =20
> thanks
> "Christian W. Damus" <cdamus@zeligsoft.com> wrote in message
> news:1213967822.6358.24.camel@cwdlappy...
> =20
> Hi, Alan,
> =20
> What you need is the resourceSetChanged() method of the
> ResourceSetListener. It is triggered after changes have been
> successfully committed by a transaction.
> =20
> All listener call-backs are performed in a read-only
> transaction. This ensures that no surprising new changes will
> occur during the processing of change notifications, ensuring
> that all listeners get the same view of the data. The
> transaction is a control freak! ;-)
> =20
> If you do need to make further changes to the model
> concomitant to the changes observed, that is exactly the
> purpose of the commands returned by a pre-commit listener.
> Why would you want to make additional changes in a new
> transaction, rather than piggy-backing on the one that is
> committing?
> =20
> Cheers,
> =20
> Christian
> =20
> =20
> On Fri, 2008-06-20 at 14:02 +0100, Alan wrote:
> =20
> > =EF=BB=BF=20
> > Hi,=20
> > Is there a way to react to changes only once the transaction
> > has committed ?=20
> > transactionAboutToCommit is before it commits obviously.=20
> > Also if this can be done will I still be able to write to
> > model. (i.e. non-read-only transaction) ?=20
> > thanks=20
> >=20
> > "Christian W. Damus" <cdamus@zeligsoft.com> wrote in
> > message news:1213812277.6416.29.camel@cwdlappy...=20
> > Hi, Alan,
> > =20
> > That is exactly the purpose of the
> > ResourceSetListener interface. Have a look at its
> > documentation in Javadoc and the EMF Model
> > Transaction Developer Guide in the SDK's on-line
> > help.
> > =20
> > An additional benefit of this transactional style of
> > listening is that you won't be notified of any
> > changes in the event that they are rolled back by
> > the transaction.
> > =20
> > HTH,
> > =20
> > Christian
> > =20
> > =20
> > On Wed, 2008-06-18 at 18:55 +0100, Alan wrote:=20
> > =20
> > > Hello all,
> > >=20
> > > I am having a problem with notifications in EMF.
> > > Basically I have a situation where all the objects in=
a model may be being=20
> > > listened to by any number of others objects.
> > > I have a transaction where I delete a number of these=
objects.
> > > A notification is sent every time I delete an individ=
ual object but this is=20
> > > causing a performance problem.
> > > What I was wondering is if there is a way to only sen=
d these notifications=20
> > > when this transaction is committed ?
> > >=20
> > > thanks.=20
> > >=20
> > >=20

--=-d7GjS77wSHig/exICjLQ
Content-Type: text/html; charset=utf-8

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.16.0">
</HEAD>
<BODY BGCOLOR="#ffffff">
Hi, Alan,<BR>
<BR>
I guess the performance will depend on just how many changes your action is performing in the one model, and how many concomitant changes it will trigger in how many other models.&nbsp; And, of course, these other models could be remote ... I don't know your situation.&nbsp; If you want to trigger changes from the post-commit listener, then you will have to do it asynchronously, because the listener is called in a read-only transaction and simply will not be able to perform any changes synchronously.<BR>
<BR>
However, I would be worried about undo/redo.&nbsp; Pre-commit commands are automatically captured by the transaction for undo/redo.&nbsp; In your case, though, you will have to rely on undo of the original action triggering compensating changes in the other models.&nbsp; The problem is how to manage the undo history.&nbsp; You don't want to asynchronously execute a command on the stack because it should not appear as a distinct command that can be undone (I expect this would surprise your users).&nbsp; However, if the other models are editable, then their undo/redo histories would be corrupted if these listener-changes are not captured on the command stack, because subsequent changes will depend on them.<BR>
<BR>
cW<BR>
<BR>
<BR>
On Fri, 2008-06-20 at 16:40 +0100, Alan wrote:<BR>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000">&#65279; </FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT SIZE="2"><FONT COLOR="#000000">Hi Christian,</FONT></FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000">&nbsp;</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT SIZE="2"><FONT COLOR="#000000">Basically changes to the shared model cause other models to react to the changes.</FONT></FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT SIZE="2"><FONT COLOR="#000000">Maybe my motivation is performance. I don't want my action slowed up by other models reacting to the changes from it.</FONT></FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT SIZE="2"><FONT COLOR="#000000">But perhaps there are other ways to solve this such as jobs, asynch threads etc ?</FONT></FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000">&nbsp;</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT SIZE="2"><FONT COLOR="#000000">thanks</FONT></FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<BLOCKQUOTE>
<FONT COLOR="#000000">&quot;Christian W. Damus&quot; &lt;<A HREF="mailto:cdamus@zeligsoft.com">cdamus@zeligsoft.com</A>&gt; wrote in message <A HREF="news:1213967822.6358.24.camel@cwdlappy">news:1213967822.6358.24.camel@cwdlappy</A>...</FONT>
</BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<BLOCKQUOTE>
<FONT COLOR="#000000">Hi, Alan,</FONT><BR>
<BR>
<FONT COLOR="#000000">What you need is the resourceSetChanged() method of the ResourceSetListener.&nbsp; It is triggered after changes have been successfully committed by a transaction.</FONT><BR>
<BR>
<FONT COLOR="#000000">All listener call-backs are performed in a read-only transaction.&nbsp; This ensures that no surprising new changes will occur during the processing of change notifications, ensuring that all listeners get the same view of the data.&nbsp; The transaction is a control freak!&nbsp; ;-)</FONT><BR>
<BR>
<FONT COLOR="#000000">If you do need to make further changes to the model concomitant to the changes observed, that is exactly the purpose of the commands returned by a pre-commit listener.&nbsp; Why would you want to make additional changes in a new transaction, rather than piggy-backing on the one that is committing?</FONT><BR>
<BR>
<FONT COLOR="#000000">Cheers,</FONT><BR>
<BR>
<FONT COLOR="#000000">Christian</FONT><BR>
<BR>
<BR>
<FONT COLOR="#000000">On Fri, 2008-06-20 at 14:02 +0100, Alan wrote:</FONT><BR>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000">&#65279; </FONT><BR>
<FONT SIZE="2"><FONT COLOR="#000000">Hi,</FONT></FONT><FONT COLOR="#000000"> </FONT><BR>
<FONT SIZE="2"><FONT COLOR="#000000">Is there a way to react to changes only once the transaction has committed ?</FONT></FONT><FONT COLOR="#000000"> </FONT><BR>
<FONT SIZE="2"><FONT COLOR="#000000">transactionAboutToCommit is before it commits obviously.</FONT></FONT><FONT COLOR="#000000"> </FONT><BR>
<FONT SIZE="2"><FONT COLOR="#000000">Also if this can be done will I still be able to write to model. (i.e. non-read-only transaction) ?</FONT></FONT><FONT COLOR="#000000"> </FONT><BR>
<FONT SIZE="2"><FONT COLOR="#000000">thanks</FONT></FONT><FONT COLOR="#000000"> </FONT><BR>
<BLOCKQUOTE>
<FONT COLOR="#000000">&quot;Christian W. Damus&quot; &lt;<A HREF="mailto:cdamus@zeligsoft.com">cdamus@zeligsoft.com</A>&gt; wrote in message <A HREF="news:1213812277.6416.29.camel@cwdlappy">news:1213812277.6416.29.camel@cwdlappy</A>... </FONT><BR>
<FONT COLOR="#000000">Hi, Alan,</FONT><BR>
<BR>
<FONT COLOR="#000000">That is exactly the purpose of the ResourceSetListener interface.&nbsp; Have a look at its documentation in Javadoc and the EMF Model Transaction Developer Guide in the SDK's on-line help.</FONT><BR>
<BR>
<FONT COLOR="#000000">An additional benefit of this transactional style of listening is that you won't be notified of any changes in the event that they are rolled back by the transaction.</FONT><BR>
<BR>
<FONT COLOR="#000000">HTH,</FONT><BR>
<BR>
<FONT COLOR="#000000">Christian</FONT><BR>
<BR>
<BR>
<FONT COLOR="#000000">On Wed, 2008-06-18 at 18:55 +0100, Alan wrote: </FONT>
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Hello all,</FONT>

<FONT COLOR="#000000">I am having a problem with notifications in EMF.</FONT>
<FONT COLOR="#000000">Basically I have a situation where all the objects in a model may be being </FONT>
<FONT COLOR="#000000">listened to by any number of others objects.</FONT>
<FONT COLOR="#000000">I have a transaction where I delete a number of these objects.</FONT>
<FONT COLOR="#000000">A notification is sent every time I delete an individual object but this is </FONT>
<FONT COLOR="#000000">causing a performance problem.</FONT>
<FONT COLOR="#000000">What I was wondering is if there is a way to only send these notifications </FONT>
<FONT COLOR="#000000">when this transaction is committed ?</FONT>

<FONT COLOR="#000000">thanks. </FONT>


</PRE>
</BLOCKQUOTE>
</BLOCKQUOTE>
</BLOCKQUOTE>
</BLOCKQUOTE>
</BLOCKQUOTE>
</BODY>
</HTML>

--=-d7GjS77wSHig/exICjLQ--
Previous Topic:Notification EMF/GMF
Next Topic:[Teneo] Setting Unique on a reference changes storage behaviour
Goto Forum:
  


Current Time: Sat Apr 20 03:23:19 GMT 2024

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

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

Back to the top