[JBoss JIRA] (TEIIDDES-1406) Use of ModellerCore.startTxn do not always set a succeeded variable to true causing an erroneous transaction rollback
by Paul Richardson (JIRA)
Paul Richardson created TEIIDDES-1406:
-----------------------------------------
Summary: Use of ModellerCore.startTxn do not always set a succeeded variable to true causing an erroneous transaction rollback
Key: TEIIDDES-1406
URL: https://issues.jboss.org/browse/TEIIDDES-1406
Project: Teiid Designer
Issue Type: Bug
Reporter: Paul Richardson
Assignee: Paul Richardson
Fix For: 8.0
{code}
boolean started = ModelerCore.startTxn(false, false, "Some task", this);
boolean succeeded = false;
try {
// do something useful here
// This succeeded is not always set to true
succeeded = true;
} catch (final Exception err) {
// log the exception
} finally {
if (started) {
if (succeeded) {
ModelerCore.commitTxn();
} else {
ModelerCore.rollbackTxn();
}
}
}
{code}
There are around 300+ instances of the call to startTxn and not all set succeeded to true.
* Better to fix this by creating a transaction callback interface that anonymous classes can implement to wrap the work.
* The succeeded flag is handled internally by the transaction framework.
* All transactions handled in the same way and the succeeded flag dealt with uniformly.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira