[EMF Transaction] Problems running two read-only transactions at the same time [message #648527] |
Thu, 13 January 2011 06:53  |
Eclipse User |
|
|
|
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 #649254 is a reply to message #649097] |
Tue, 18 January 2011 07:06  |
Eclipse User |
|
|
|
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
>>
|
|
|
Powered by
FUDForum. Page generated in 0.04072 seconds