[ http://jira.jboss.com/jira/browse/JBAS-782?page=history ]
Scott M Stark reassigned JBAS-782:
----------------------------------
Assign To: Adrian Brock (was: Scott M Stark)
> Transaction tests wrong status
> ------------------------------
>
> Key: JBAS-782
> URL: http://jira.jboss.com/jira/browse/JBAS-782
> Project: JBoss Application Server
> Type: Bug
> Components: Test Suite
> Versions: JBossAS-3.2.6 Final
> Reporter: SourceForge User
> Assignee: Adrian Brock
>
>
> SourceForge Submitter: marklittle .
> Some of the more recent JBoss tests are based around
> ensuring the status returned for committed/rolledback
> transaction is correct. For example:
> TransactionManager.begin()
> Transaction tx = TransactionManager.getTransaction();
> TransactionManager.commit();
> If ( tx.getStatus() !=
> Status.STATUS_NO_TRANSACTION ) {
> fail;
> }
> Else
> {
> pass;
> }
> Unfortunately the JTA spec. mixes some wrong concepts
> and is poorly defined here (yet again). The test above
> may be valid if performed on the TransactionManager
> instance and not the transaction *if and only if* there
> are no heuristic outcomes (in which case the transaction
> won't be disassociated from the invoking thread and so
> getStatus will be performed on the underlying
> transaction object.)
> If the test is performed on the actual transaction object
> (as it currently is) then not only won't it work if
> heuristics are present, but it's also implementation
> dependant as to whether the transaction object has to
> return STATUS_NO_TRANSACTION on successful
> commit - it could return STATUS_COMMITTED (or even
> STATUS_ROLLEDBACK if it rolled back).
> On the assumption that the tests are just supposed to
> make sure that transactions ended the way the test
> requested *and* thread disassociation occurred, it
> would make more sense to move the test to be on the
> TransactionManager rather than the Transaction.
> Ignoring heuristics (for which you'd want the test to fail
> anyway), this is the best way to guarantee that the
> test will work regardless of the underlying
> implementation.
> Mark.
--
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
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
JBoss-Development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-development