Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [EMF Transaction] Problems running two read-only transactions at the same time
[EMF Transaction] Problems running two read-only transactions at the same time [message #648527] Thu, 13 January 2011 11:53 Go to next message
Jan Mauersberger is currently offline Jan MauersbergerFriend
Messages: 120
Registered: July 2009
Senior Member
Hi,

I have a very simple test case: a transactional editing domain, a single
resource, a single object. I start two threads that execute long running
loops as the following:

for (int i = 0; i < 1000; i++) {
...
editingDomain.runExclusive(runnable);
}

That's it. The runnable is simply asserting that the code is executed in
a transaction. However, in many cases this test fails with an exception:

java.lang.IllegalArgumentException: Can only deactivate the active
transaction
at
org.eclipse.emf.transaction.impl.TransactionalEditingDomainI mpl.deactivate(TransactionalEditingDomainImpl.java:533)
at
org.eclipse.emf.transaction.impl.TransactionImpl.close(Trans actionImpl.java:712)
at
org.eclipse.emf.transaction.impl.TransactionImpl.commit(Tran sactionImpl.java:474)
at
org.eclipse.emf.transaction.impl.TransactionalEditingDomainI mpl.runExclusive(TransactionalEditingDomainImpl.java:333)

It seems that the editing domain code is not able to handle multiple
read-only (and only read-only) transactions at the same time which isn't
what I would expect from the transaction framework.

Is there any mistake in my thoughts or is this a known issue or am I
missing something?

Thanks Jan
Re: [EMF Transaction] Problems running two read-only transactions at the same time [message #649024 is a reply to message #648527] Mon, 17 January 2011 09:20 Go to previous messageGo to next message
Jan Mauersberger is currently offline Jan MauersbergerFriend
Messages: 120
Registered: July 2009
Senior Member
Small update: the problem only occurs when running the test case as
plain test (no eclipse runtime). When run as plugin test (within the
eclipse runtime) the code behaves as expected. I thought that EMF core
resp. eclipse transactions do not depend on an eclipse runtime?

Jan

> Hi,
>
> I have a very simple test case: a transactional editing domain, a single
> resource, a single object. I start two threads that execute long running
> loops as the following:
>
>...
> Thanks Jan
Re: [EMF Transaction] Problems running two read-only transactions at the same time [message #649097 is a reply to message #649024] Mon, 17 January 2011 16:17 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Jan,

I think transactions do depend on the workspace...


Jan Mauersberger wrote:
> Small update: the problem only occurs when running the test case as
> plain test (no eclipse runtime). When run as plugin test (within the
> eclipse runtime) the code behaves as expected. I thought that EMF core
> resp. eclipse transactions do not depend on an eclipse runtime?
>
> Jan
>
>> Hi,
>>
>> I have a very simple test case: a transactional editing domain, a single
>> resource, a single object. I start two threads that execute long running
>> loops as the following:
>>
>> ...
>> Thanks Jan
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: [EMF Transaction] Problems running two read-only transactions at the same time [message #649254 is a reply to message #649097] Tue, 18 January 2011 12:06 Go to previous message
Jan Mauersberger is currently offline Jan MauersbergerFriend
Messages: 120
Registered: July 2009
Senior Member
Ed,

that would explain the behavior. Since I do not plan to run the real
code outside an eclipse runtime the issue is solved for me.

Thanks Jan

> Jan,
>
> I think transactions do depend on the workspace...
>
>
> Jan Mauersberger wrote:
>> Small update: the problem only occurs when running the test case as
>> plain test (no eclipse runtime). When run as plugin test (within the
>> eclipse runtime) the code behaves as expected. I thought that EMF core
>> resp. eclipse transactions do not depend on an eclipse runtime?
>>
>> Jan
>>
>>> Hi,
>>>
>>> I have a very simple test case: a transactional editing domain, a single
>>> resource, a single object. I start two threads that execute long running
>>> loops as the following:
>>>
>>> ...
>>> Thanks Jan
>>
Previous Topic:[CDO] URI of the resource ... does not match the nsURI ... of the top-level package
Next Topic:Compilation errors in generated code when using generic types with maps
Goto Forum:
  


Current Time: Thu Mar 28 08:20:28 GMT 2024

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

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

Back to the top