[
https://issues.jboss.org/browse/TEIIDDES-1406?page=com.atlassian.jira.plu...
]
Paul Richardson resolved TEIIDDES-1406.
---------------------------------------
Resolution: Done
Rather than a major API change, the fix has been paired back to just ensuring the current
transaction framework is consistent across the 300 or so implementations, eg. including a
finally clause, ensuring a succeeded flag is set.
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