<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
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>
</body>
</html>