Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Transaction] createPrivilegedRunnable
[Transaction] createPrivilegedRunnable [message #84964] Fri, 25 May 2007 14:51 Go to next message
Eclipse UserFriend
Originally posted by: james.willans.xactium.com

Is it possible to enable an already running java thread to update
resources within a transactional editing domain? createPrivilegedRunnable
seems to force you to start the thread that is returned, but the thread in
question has already been started.

Thanks,

James
Re: [Transaction] createPrivilegedRunnable [message #84998 is a reply to message #84964] Fri, 25 May 2007 15:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, James,

Please use the EMF newsgroup (included in my reply) for questions about the
Transaction component.

The privileged runnable doesn't impose any restriction on when a client
should start the thread that is to run the runnable.
TransactionalEditingDomain::createPrivilegedRunnable() doesn't return a
thread; it returns a runnable.

To execute the runnable on a thread that is already in progress, you can use
whatever means that thread provides. The most common example is the
display thread: you would run the runnable on the display thread using
Display::syncExec() on the Display object corresponding to the target
thread.

Note that it attempting to run the privileged runnable asynchronously (with
respect to the thread that currently owns the transaction) is absolutely
out of the question, as it will surely result in corruption of the
transaction state.

For more information, see the Programmer's Guide topic about sharing
transactions between threads, which is new since 1.1 M7.

HTH,

Christian

James Willans wrote:

> Is it possible to enable an already running java thread to update
> resources within a transactional editing domain? createPrivilegedRunnable
> seems to force you to start the thread that is returned, but the thread in
> question has already been started.
>
> Thanks,
>
> James
Re: [Transaction] createPrivilegedRunnable [message #85013 is a reply to message #84998] Fri, 25 May 2007 15:40 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Oops ... forgot to redirect to the EMF newsgroup

cW

Christian W. Damus wrote:

> Hi, James,
>
> Please use the EMF newsgroup (included in my reply) for questions about
> the Transaction component.
>
> The privileged runnable doesn't impose any restriction on when a client
> should start the thread that is to run the runnable.
> TransactionalEditingDomain::createPrivilegedRunnable() doesn't return a
> thread; it returns a runnable.
>
> To execute the runnable on a thread that is already in progress, you can
> use
> whatever means that thread provides. The most common example is the
> display thread: you would run the runnable on the display thread using
> Display::syncExec() on the Display object corresponding to the target
> thread.
>
> Note that it attempting to run the privileged runnable asynchronously
> (with respect to the thread that currently owns the transaction) is
> absolutely out of the question, as it will surely result in corruption of
> the transaction state.
>
> For more information, see the Programmer's Guide topic about sharing
> transactions between threads, which is new since 1.1 M7.
>
> HTH,
>
> Christian
>
> James Willans wrote:
>
>> Is it possible to enable an already running java thread to update
>> resources within a transactional editing domain?
>> createPrivilegedRunnable seems to force you to start the thread that is
>> returned, but the thread in question has already been started.
>>
>> Thanks,
>>
>> James
Re: [Transaction] createPrivilegedRunnable [message #606796 is a reply to message #84964] Fri, 25 May 2007 15:40 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, James,

Please use the EMF newsgroup (included in my reply) for questions about the
Transaction component.

The privileged runnable doesn't impose any restriction on when a client
should start the thread that is to run the runnable.
TransactionalEditingDomain::createPrivilegedRunnable() doesn't return a
thread; it returns a runnable.

To execute the runnable on a thread that is already in progress, you can use
whatever means that thread provides. The most common example is the
display thread: you would run the runnable on the display thread using
Display::syncExec() on the Display object corresponding to the target
thread.

Note that it attempting to run the privileged runnable asynchronously (with
respect to the thread that currently owns the transaction) is absolutely
out of the question, as it will surely result in corruption of the
transaction state.

For more information, see the Programmer's Guide topic about sharing
transactions between threads, which is new since 1.1 M7.

HTH,

Christian

James Willans wrote:

> Is it possible to enable an already running java thread to update
> resources within a transactional editing domain? createPrivilegedRunnable
> seems to force you to start the thread that is returned, but the thread in
> question has already been started.
>
> Thanks,
>
> James
Re: [Transaction] createPrivilegedRunnable [message #606797 is a reply to message #84998] Fri, 25 May 2007 15:40 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Oops ... forgot to redirect to the EMF newsgroup

cW

Christian W. Damus wrote:

> Hi, James,
>
> Please use the EMF newsgroup (included in my reply) for questions about
> the Transaction component.
>
> The privileged runnable doesn't impose any restriction on when a client
> should start the thread that is to run the runnable.
> TransactionalEditingDomain::createPrivilegedRunnable() doesn't return a
> thread; it returns a runnable.
>
> To execute the runnable on a thread that is already in progress, you can
> use
> whatever means that thread provides. The most common example is the
> display thread: you would run the runnable on the display thread using
> Display::syncExec() on the Display object corresponding to the target
> thread.
>
> Note that it attempting to run the privileged runnable asynchronously
> (with respect to the thread that currently owns the transaction) is
> absolutely out of the question, as it will surely result in corruption of
> the transaction state.
>
> For more information, see the Programmer's Guide topic about sharing
> transactions between threads, which is new since 1.1 M7.
>
> HTH,
>
> Christian
>
> James Willans wrote:
>
>> Is it possible to enable an already running java thread to update
>> resources within a transactional editing domain?
>> createPrivilegedRunnable seems to force you to start the thread that is
>> returned, but the thread in question has already been started.
>>
>> Thanks,
>>
>> James
Previous Topic:[Teneo] Cache annotation and superClass
Next Topic:[Teneo] Cache annotation and superClass
Goto Forum:
  


Current Time: Tue Jan 19 22:34:47 GMT 2021

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

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

Back to the top