|
Re: InterruptedException in EMF Transaction layer [message #429862 is a reply to message #429855] |
Tue, 05 May 2009 15:29 |
|
--=-nPk27t+3mJqL0mGeR6A4
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Hi, Alex,
I can explain what happened, but not what to do about it.
1. The UI thread attempted to start a transaction, and in so doing
block on a Lock::AcquireRule waiting for a job to get the
transaction lock on its behalf.
2. This wasn't immediately available, so the Blocked UI Jobs dialog
was shown to alert the user that there is some hold-up.
3. Once the lock became available, the UI thread was granted the
Lock::AcquireRule that it was waiting for and the dialog was
taken down.
4. The disappearance of the model dialog re-activated the workbench
window, which in turn re-activated some part in that window.
5. This part, on activation, attempts to start another transaction
on the UI thread. However, a transaction is already in
progress, so the second attempt to start is aborted by an
InterruptException.
I think this is quite what you would want to happen: the original
transaction is protected against corruption by the re-entrant attempt to
start another. It is unfortunate that a part activation listener is
trying to start a transaction, but it should be aware that it is running
on the UI thread and that it is therefore subject to interruption, from
which it must recover somehow. There's just no way around that.
HTH,
Christian
On Tue, 2009-05-05 at 10:05 +0000, Alex Boyko wrote:
> Hi all,
>
> While working on a diagram editor based on GMF I ran into a weird
> exception (stack trace below).
> Does anyone knows why it was thrown and what it means? Any ideas are
> appreciated.
> Thanks in advance.
>
> Cheers,
> Alex
>
> java.lang.InterruptedException: Attempted to beginRule:
> org.eclipse.emf.transaction.util.Lock$AcquireRule@2db02db, does not match
> outer scope rule:
> org.eclipse.emf.transaction.util.Lock$AcquireRule@1a0f1a0f
> at org.eclipse.emf.transaction.util.Lock.uiSafeAcquire(Lock.jav a:475)
-----8<-----
--=-nPk27t+3mJqL0mGeR6A4
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.24.1.1">
</HEAD>
<BODY>
Hi, Alex,<BR>
<BR>
I can explain what happened, but not what to do about it.<BR>
<BR>
<OL TYPE=1>
<LI TYPE=1 VALUE=1>The UI thread attempted to start a transaction, and in so doing block on a Lock::AcquireRule waiting for a job to get the transaction lock on its behalf.
<LI TYPE=1 VALUE=2>This wasn't immediately available, so the Blocked UI Jobs dialog was shown to alert the user that there is some hold-up.
<LI TYPE=1 VALUE=3>Once the lock became available, the UI thread was granted the Lock::AcquireRule that it was waiting for and the dialog was taken down.
<LI TYPE=1 VALUE=4>The disappearance of the model dialog re-activated the workbench window, which in turn re-activated some part in that window.
<LI TYPE=1 VALUE=5>This part, on activation, attempts to start another transaction on the UI thread. However, a transaction is already in progress, so the second attempt to start is aborted by an InterruptException.
</OL>
I think this is quite what you would want to happen: the original transaction is protected against corruption by the re-entrant attempt to start another. It is unfortunate that a part activation listener is trying to start a transaction, but it should be aware that it is running on the UI thread and that it is therefore subject to interruption, from which it must recover somehow. There's just no way around that.<BR>
<BR>
HTH,<BR>
<BR>
Christian<BR>
<BR>
<BR>
On Tue, 2009-05-05 at 10:05 +0000, Alex Boyko wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
Hi all,
While working on a diagram editor based on GMF I ran into a weird
exception (stack trace below).
Does anyone knows why it was thrown and what it means? Any ideas are
appreciated.
Thanks in advance.
Cheers,
Alex
java.lang.InterruptedException: Attempted to beginRule:
org.eclipse.emf.transaction.util.Lock$AcquireRule@2db02db, does not match
outer scope rule:
org.eclipse.emf.transaction.util.Lock$AcquireRule@1a0f1a0f
at org.eclipse.emf.transaction.util.Lock.uiSafeAcquire(Lock.jav a:475)
</PRE>
</BLOCKQUOTE>
<BR>
-----8<-----<BR>
<BR>
</BODY>
</HTML>
--=-nPk27t+3mJqL0mGeR6A4--
|
|
|
Powered by
FUDForum. Page generated in 0.03175 seconds