[JBoss JIRA] Created: (JBRULES-2937) JtaTransactionManager should use setRollbackOnly instead of rollback for non-local transactions
by Vlastimil Menčík (JIRA)
JtaTransactionManager should use setRollbackOnly instead of rollback for non-local transactions
-----------------------------------------------------------------------------------------------
Key: JBRULES-2937
URL: https://issues.jboss.org/browse/JBRULES-2937
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 5.2.0.M1
Environment: WinXP, Oracle Java 1.6.0_20, 32bit, JBoss AS 6.0.0.Final, jBPM 5.0.0
Reporter: Vlastimil Menčík
Assignee: Mark Proctor
This problem concerns the {{drools-persistence-jpa}} module and its {{org.drools.persistence.jta.JtaTransactionManager}}.
The {{JtaTransactionManager}} has a notion of local transactions. These are the JTA transactions that it itself started using [UserTransaction.begin()|http://download.oracle.com/javaee/6/api/javax/tra...].
If a JTA transaction is already active when {{JtaTransactionManager.begin()}} is called, then the execution continues in this JTA transaction and a new one is not started. Let's call such JTA transaction non-local.
The problem is that {{JtaTransactionManager.rollback()}} treats local and non-local JTA transactions the same way and calls [UserTransaction.rollback()|http://download.oracle.com/javaee/6/api/javax/...] in both cases. In case of a non-local transaction is this behaviour IMHO wrong, because the rollback should be a responsibility of the same client that started the JTA transaction.
Imagine the following situation (jBPM process execution):
{code}
StatefulKnowledgeSession session = ...
UserTransaction ut = ...
ut.begin();
try {
session.startProcess("my.process"); // the process execution may cause an exception (most likely in some WorkItemHandler)
ut.commit();
} catch (Exception e) {
ut.rollback(); // now this throws an IllegalStateException, because JtaTransactionManager already rolled back the transaction
}
{code}
There is of course a workaround: the client code has to check [status|http://download.oracle.com/javaee/6/api/javax/transaction/UserTran...] of the JTA transaction and must not call {{rollback()}}, if the transaction was already rolled back by the {{JtaTransactionManager}}.
IMHO the relevant JtaTransactionManager code should call [UserTransaction.setRollbackOnly|http://download.oracle.com/javaee/6/api/j...] for non-local transactions:
{code}
public void rollback() {
boolean wasLocal = localTransaction; // localTransaction is a private boolean field of JtaTransactionManager already present in current implementation
localTransaction = false;
try {
wasLocal ? this.ut.rollback() : this.ut.setRollbackOnly();
} catch ( Exception e ) {
logger.warn( "Unable to rollback transaction", e);
throw new RuntimeException( "Unable to rollback transaction", e );
}
}
{code}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 7 months
[JBoss JIRA] Created: (JBRULES-1559) Ability to negate a constraint group
by Dirk Bergstrom (JIRA)
Ability to negate a constraint group
------------------------------------
Key: JBRULES-1559
URL: http://jira.jboss.com/jira/browse/JBRULES-1559
Project: JBoss Drools
Issue Type: Feature Request
Security Level: Public (Everyone can see)
Components: Drl Parser/Builder
Affects Versions: FUTURE
Reporter: Dirk Bergstrom
Assigned To: Mark Proctor
Priority: Minor
I want to write a rule that says "Find all long-eared dogs that do not have
short, black hair". This seems like the simple way to do it:
collect( Dog( ears=="long",
not (hair=="short" && color=="black") )
But that doesn't parse. Some digging through the archives unearthed a mention
of De Morgan's laws, which leads to: http://en.wikipedia.org/wiki/De_Morgan's_laws
Which explains that I can instead write:
collect( Dog( ears=="long", (hair!="short" || color!="black") )
Which, after some mental effort, turns out to be the right thing.
However, had I not found the reference to De Morgan's Law, it would have taken
me a long time to get there (if indeed I ever would have). The end result is
also quite difficult to parse if you're not a logician, and thus not very
user-friendly.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 7 months
[JBoss JIRA] Created: (JBRULES-1662) Tomcat Debugging of Rules
by Paul Ryan (JIRA)
Tomcat Debugging of Rules
-------------------------
Key: JBRULES-1662
URL: http://jira.jboss.com/jira/browse/JBRULES-1662
Project: JBoss Drools
Issue Type: Feature Request
Security Level: Public (Everyone can see)
Components: Eclipse IDE
Environment: Tomcat 5+ and Eclipse IDE
Reporter: Paul Ryan
Assigned To: Mark Proctor
The ability to debug rules while running from a tomcat instance. This would be helpful for those of us that have services wrapping the rules so that we can debug into running rule sets. This feature should be capable of running its own instance of tomcat as well as attaching to a debug version of an externally running tomcat to allow for flexibility based on the users socket needs.
This feature would be a huge selling point for enterprise applications of Drools.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 7 months
[JBoss JIRA] Created: (JBRULES-2113) NPE thrown by LeftTuple.get() method
by Tom Murphy (JIRA)
NPE thrown by LeftTuple.get() method
------------------------------------
Key: JBRULES-2113
URL: https://jira.jboss.org/jira/browse/JBRULES-2113
Project: JBoss Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 5.0.0.CR1
Environment: FOund in 5.0.0.CR1 - Community version. Windows XP
Reporter: Tom Murphy
Assignee: Mark Proctor
the get() method on LeftTuple throws a null exception under certain circumstances, which are as yet undetermined.
Here is the Code:
public InternalFactHandle get(final int index) {
LeftTuple entry = this;
while ( entry.index != index ) {
entry = entry.parent;
}
return entry.handle;
}
Note that the loop moves to each parent in succession, but never checks for entry != null. If it does get to the end of the chain, it will throw an NPE
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 7 months