Bugs item #840582, was opened at 2003-11-12 09:06
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=840582&group_id=22866

Category: JBossTest
Group: v3.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Mark Little (marklittle)
Assigned to: Nobody/Anonymous (nobody)
Summary: Transaction tests wrong status

Initial Comment:
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.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=840582&group_id=22866


-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to