<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi, <br>
<br>
Uhm.. yeah, ignore this past message?<br>
<br>
(I probably should have googled "JTA local transactions" before
sending the message). <br>
<br>
<br>
Sorry!<br>
<br>
Thanks,<br>
Marco<br>
<br>
<br>
<br>
08/18/2011 11:32 PM, Marco Rietveld:
<blockquote cite="mid:4E4D84D3.6020708@redhat.com" type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
Hi, <br>
<br>
Apologies if this message is any way inappropriate (wrong place,
etc.)<br>
<br>
After having read the following code in<tt>
org.drools.persistence.jta.JtaTransactionManager</tt> 1000
times, I realized that there was something a little fishy about
the code in<tt> JtaTransactionManager.commit()</tt> (see code
(especially in blue) below). <br>
<br>
It seems like the private boolean localTransaction is being used
to provide basic (1 level) of transaction nesting -- but that it
doesn't do that (no un-nesting) and needs to be fixed. <br>
<br>
If anyone wouldn't mind speaking up (on- or off-list) about what
exactly the code was meant to do or otherwise what the idea was
when the code was written, I'd appreciate it! I obviously have my
own ideas, but want to make sure I'm not missing anything. <br>
<br>
<blockquote type="cite"><tt>public void begin() {<br>
if ( getStatus() ==
TransactionManager.STATUS_NO_TRANSACTION ) {<br>
<b>this.localTransaction = true;</b><br>
try {<br>
this.ut.begin();<br>
} catch ( Exception e ) {<br>
logger.warn( "Unable to begin transaction", e);<br>
throw new RuntimeException( "Unable to begin
transaction",<br>
e );<br>
}<br>
} else {<br>
<b> this.localTransaction = false;</b><br>
}<br>
}<br>
<br>
public void commit() {<br>
<b> if ( this.localTransaction ) {</b><br>
try {<br>
this.ut.commit();<br>
} catch ( Exception e ) {<br>
logger.warn( "Unable to commit transaction", e);<br>
throw new RuntimeException( "Unable to commit
transaction",<br>
e );<br>
}<br>
<font color="#3333ff"><b> } else {<br>
localTransaction = false;<br>
}</b></font><br>
}</tt><br>
</blockquote>
<br>
(It's not making sense to me why you would set a false boolean
to.. false. :) And I have the idea that the else clause was meant
to "un-nest" the logical transaction. )<br>
<br>
Thanks, <br>
Marco<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
rules-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-dev">https://lists.jboss.org/mailman/listinfo/rules-dev</a>
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Drools/jBPM developer
Utrecht, the Netherlands</pre>
</body>
</html>