Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Discovering transaction insertion point
Discovering transaction insertion point [message #26542] Thu, 02 March 2006 15:16 Go to next message
No real name is currently offline No real nameFriend
Messages: 29
Registered: July 2009
Junior Member
Dear all,

i'm starting the process of converting an emf/gef editor into a
transactional one. The problem i'm currently facing is the one of finding
out the point into which transaction should be inserted (i.e. where the
resource' elements are read or modified). Is it there a way to
(automatically) find out them? Looking at the source code is boring and
error prone (expecially for the gef stuff).



Best regards
Re: Discovering transaction insertion point [message #26873 is a reply to message #26542] Thu, 02 March 2006 20:17 Go to previous messageGo to next message
Vishy Ramaswamy is currently offline Vishy RamaswamyFriend
Messages: 30
Registered: July 2009
Member
Hi,

Please refer to the transaction examples plugin within the transaction
examples sdk or the transactions sdk. The plugin is

org.eclipse.emf.workspace.examples.library.editor

This plugin conatins an example editor
(org.eclipse.emf.workspace.examples.extlibrary.presentation. EXTLibraryEditor
) that demonstrates the integration of the TransactionalEditingDomain into
the editor. This should be a good starting point



Thanks

Vishy



"sf76" <sf76@hotmail.com> wrote in message
news:dfc98f34d58f9fd47e2da564d7769674$1@www.eclipse.org...
> Dear all,
>
> i'm starting the process of converting an emf/gef editor into a
> transactional one. The problem i'm currently facing is the one of finding
> out the point into which transaction should be inserted (i.e. where the
> resource' elements are read or modified). Is it there a way to
> (automatically) find out them? Looking at the source code is boring and
> error prone (expecially for the gef stuff).
>
>
>
> Best regards
>
Re: Discovering transaction insertion point [message #26954 is a reply to message #26873] Thu, 02 March 2006 22:22 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Yes, you might be particularly interested to see how the example editor
installs custom property sources for the Properties view, to ensure that it
reads the model in read-only transactions. Perhaps this illustrates the
considerable extent to which the transaction protocol will permeate a UI
application ...

Christian


Vishy Ramaswamy wrote:

> Hi,
>
> Please refer to the transaction examples plugin within the transaction
> examples sdk or the transactions sdk. The plugin is
>
> org.eclipse.emf.workspace.examples.library.editor
>
> This plugin conatins an example editor
>
(org.eclipse.emf.workspace.examples.extlibrary.presentation. EXTLibraryEditor
> ) that demonstrates the integration of the TransactionalEditingDomain into
> the editor. This should be a good starting point
>
>
>
> Thanks
>
> Vishy

<snip>
Re: Discovering transaction insertion point [message #27032 is a reply to message #26954] Fri, 03 March 2006 13:57 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 29
Registered: July 2009
Junior Member
Dear all,

i've already looked at the suggested plugin and, even not being an expert
of emf, i think it is a great source of example/ideas about the
integration of the emft component into an emf editor (and i've borrowed
many of them).

The point of my question was slightly different: is it there a way in
order to discover all the places in an application that should be
converted into an emft transaction?

At the moment i'm converting a gef editor into a transactional one in
order to evaluate emft capability. Since i don't own all of the code (i.e.
gef cmd) i need to look manually at the points in which to insert emft
constructs. Forgetting one gives an IllegalStateException throwed at
runtime. Is it there a strategy or some kind of tricks in order to avoid
such problems?


Thanks again,
Best regards
Re: Discovering transaction insertion point [message #27110 is a reply to message #27032] Fri, 03 March 2006 22:25 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Ah, I see what you are looking for.

We do not yet have any means to assist in finding what code needs to be
"transactionalized" (if I may coin a word). We have given thought to some
potential strategies for inserting debug-time assertions into EMF and/or
generated metamodel code to check that the caller is in a transaction
context, and have mostly drawn blanks.

For now, we have only the obvious rule of thumb: whenever you're calling
code that *may* read from the model, do it in a read-only transaction.
Unless that code might also write to the model, in which case a read/write
transaction is required. The latter case is more tricky because the normal
way of creating a read/write transaction is either to execute a Command on
a CommandStack or an AbstractEMFOperation on an IOperationHistory. In
either of these cases, you want to be sure that the command/operation will
actually make some change, otherwise the Undo menu will have an ineffective
undo action on it!

Some kind of code-flow analysis tool might be able to indicate points in
your code from which the control graph will eventually enter the EMF APIs
that perform reads, but this is complicated by the sheer number of APIs in
EMF that read.

Cheers,

Christian


sf76 wrote:

> Dear all,
>
> i've already looked at the suggested plugin and, even not being an expert
> of emf, i think it is a great source of example/ideas about the
> integration of the emft component into an emf editor (and i've borrowed
> many of them).
>
> The point of my question was slightly different: is it there a way in
> order to discover all the places in an application that should be
> converted into an emft transaction?
>
> At the moment i'm converting a gef editor into a transactional one in
> order to evaluate emft capability. Since i don't own all of the code (i.e.
> gef cmd) i need to look manually at the points in which to insert emft
> constructs. Forgetting one gives an IllegalStateException throwed at
> runtime. Is it there a strategy or some kind of tricks in order to avoid
> such problems?
>
>
> Thanks again,
> Best regards
Re: Discovering transaction insertion point [message #571038 is a reply to message #26542] Thu, 02 March 2006 20:17 Go to previous message
Vishy Ramaswamy is currently offline Vishy RamaswamyFriend
Messages: 30
Registered: July 2009
Member
Hi,

Please refer to the transaction examples plugin within the transaction
examples sdk or the transactions sdk. The plugin is

org.eclipse.emf.workspace.examples.library.editor

This plugin conatins an example editor
(org.eclipse.emf.workspace.examples.extlibrary.presentation. EXTLibraryEditor
) that demonstrates the integration of the TransactionalEditingDomain into
the editor. This should be a good starting point



Thanks

Vishy



"sf76" <sf76@hotmail.com> wrote in message
news:dfc98f34d58f9fd47e2da564d7769674$1@www.eclipse.org...
> Dear all,
>
> i'm starting the process of converting an emf/gef editor into a
> transactional one. The problem i'm currently facing is the one of finding
> out the point into which transaction should be inserted (i.e. where the
> resource' elements are read or modified). Is it there a way to
> (automatically) find out them? Looking at the source code is boring and
> error prone (expecially for the gef stuff).
>
>
>
> Best regards
>
Re: Discovering transaction insertion point [message #571147 is a reply to message #26873] Thu, 02 March 2006 22:22 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Yes, you might be particularly interested to see how the example editor
installs custom property sources for the Properties view, to ensure that it
reads the model in read-only transactions. Perhaps this illustrates the
considerable extent to which the transaction protocol will permeate a UI
application ...

Christian


Vishy Ramaswamy wrote:

> Hi,
>
> Please refer to the transaction examples plugin within the transaction
> examples sdk or the transactions sdk. The plugin is
>
> org.eclipse.emf.workspace.examples.library.editor
>
> This plugin conatins an example editor
>
(org.eclipse.emf.workspace.examples.extlibrary.presentation. EXTLibraryEditor
> ) that demonstrates the integration of the TransactionalEditingDomain into
> the editor. This should be a good starting point
>
>
>
> Thanks
>
> Vishy

<snip>
Re: Discovering transaction insertion point [message #571249 is a reply to message #26954] Fri, 03 March 2006 13:57 Go to previous message
No real name is currently offline No real nameFriend
Messages: 29
Registered: July 2009
Junior Member
Dear all,

i've already looked at the suggested plugin and, even not being an expert
of emf, i think it is a great source of example/ideas about the
integration of the emft component into an emf editor (and i've borrowed
many of them).

The point of my question was slightly different: is it there a way in
order to discover all the places in an application that should be
converted into an emft transaction?

At the moment i'm converting a gef editor into a transactional one in
order to evaluate emft capability. Since i don't own all of the code (i.e.
gef cmd) i need to look manually at the points in which to insert emft
constructs. Forgetting one gives an IllegalStateException throwed at
runtime. Is it there a strategy or some kind of tricks in order to avoid
such problems?


Thanks again,
Best regards
Re: Discovering transaction insertion point [message #571326 is a reply to message #27032] Fri, 03 March 2006 22:25 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Ah, I see what you are looking for.

We do not yet have any means to assist in finding what code needs to be
"transactionalized" (if I may coin a word). We have given thought to some
potential strategies for inserting debug-time assertions into EMF and/or
generated metamodel code to check that the caller is in a transaction
context, and have mostly drawn blanks.

For now, we have only the obvious rule of thumb: whenever you're calling
code that *may* read from the model, do it in a read-only transaction.
Unless that code might also write to the model, in which case a read/write
transaction is required. The latter case is more tricky because the normal
way of creating a read/write transaction is either to execute a Command on
a CommandStack or an AbstractEMFOperation on an IOperationHistory. In
either of these cases, you want to be sure that the command/operation will
actually make some change, otherwise the Undo menu will have an ineffective
undo action on it!

Some kind of code-flow analysis tool might be able to indicate points in
your code from which the control graph will eventually enter the EMF APIs
that perform reads, but this is complicated by the sheer number of APIs in
EMF that read.

Cheers,

Christian


sf76 wrote:

> Dear all,
>
> i've already looked at the suggested plugin and, even not being an expert
> of emf, i think it is a great source of example/ideas about the
> integration of the emft component into an emf editor (and i've borrowed
> many of them).
>
> The point of my question was slightly different: is it there a way in
> order to discover all the places in an application that should be
> converted into an emft transaction?
>
> At the moment i'm converting a gef editor into a transactional one in
> order to evaluate emft capability. Since i don't own all of the code (i.e.
> gef cmd) i need to look manually at the points in which to insert emft
> constructs. Forgetting one gives an IllegalStateException throwed at
> runtime. Is it there a strategy or some kind of tricks in order to avoid
> such problems?
>
>
> Thanks again,
> Best regards
Previous Topic:ocl newbie question
Next Topic:problem installing ocl
Goto Forum:
  


Current Time: Thu Apr 18 01:09:04 GMT 2024

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

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

Back to the top