geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Hogstrom (JIRA)" <>
Subject [jira] Closed: (DAYTRADER-8) Small difference in sync order processing between Direct and EJB mode
Date Tue, 25 Jul 2006 18:20:15 GMT
     [ ]

Matt Hogstrom closed DAYTRADER-8.

    Fix Version/s: 1.2
       Resolution: Fixed

Thanks for the patch Chris...applied.

Sending        modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/direct/
Transmitting file data .
Committed revision 425477.

> Small difference in sync order processing between Direct and EJB mode
> ---------------------------------------------------------------------
>                 Key: DAYTRADER-8
>                 URL:
>             Project: DayTrader
>          Issue Type: Bug
>          Components: EJB Tier
>    Affects Versions: 1.1
>            Reporter: Christopher James Blythe
>            Priority: Minor
>             Fix For: 1.2
>         Attachments: orderPatch.diff
> I have noticed a slight difference in the behavior of synchronous  buy/sell operations
between EJB and JDBC mode. For example, in Sync/Direct mode, if you perform a buy operation
the resulting output of the NewOrder pages will look something like the following...
> 271002  	open  	2006-07-19 17:04:50.921  	null  	24.95  	buy  	s:0  	100.0
> If I perform the same operation in Sync/EJB mode, I get the following...
> 272002  	closed  	2006-07-19 17:12:25.156  	2006-07-19 17:12:25.156  	24.95  	buy  	s:1
> Notice the differences between the two...
> - the status (closed vs. open)
> - the completion date (null vs an actual value)
> I have looked into the code for this and it seems that the EJB version actually returns
a refreshed version of the bean (as performed by the ejb container). However, in the JDBC/Direct
code we perform the necessary updates to the order via the order processing apis, but we never
update the actual local copy of the order bean before returning this.
> I realize this may be a minor detail, but it does point out a slight difference between
the execution of Direct/EJB mode. The simple solution is to re-fetch the order data before
the buy/sell operations are completed in the code, similar to the following...
> orderData = getOrderData(conn, orderData.getOrderID().intValue());
> if (txn != null) {
> 	if ( Log.doTrace() )
> 		Log.trace("TradeDirect:sell committing global transaction");		
> 		txn.commit();
> 		setInGlobalTxn(false);
> 	}
> else	
> 	commit(conn);
> Will attach a patch with this code tomorrow morning...

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


View raw message