Return-Path: Delivered-To: apmail-geronimo-dev-archive@www.apache.org Received: (qmail 16048 invoked from network); 25 Jul 2006 18:23:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 25 Jul 2006 18:23:30 -0000 Received: (qmail 7009 invoked by uid 500); 25 Jul 2006 18:23:28 -0000 Delivered-To: apmail-geronimo-dev-archive@geronimo.apache.org Received: (qmail 6972 invoked by uid 500); 25 Jul 2006 18:23:28 -0000 Mailing-List: contact dev-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list dev@geronimo.apache.org Received: (qmail 6956 invoked by uid 99); 25 Jul 2006 18:23:28 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Jul 2006 11:23:28 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=RCVD_IN_SORBS_WEB,SPF_HELO_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [63.208.196.171] (HELO outbound.mailhop.org) (63.208.196.171) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Jul 2006 11:23:27 -0700 Received: from bi01p1.nc.us.ibm.com ([129.33.49.251] helo=[9.37.214.153]) by outbound.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.51) id 1G5RYh-000NhX-35 for dev@geronimo.apache.org; Tue, 25 Jul 2006 14:23:07 -0400 X-Mail-Handler: MailHop Outbound by DynDNS X-Originating-IP: 129.33.49.251 X-Report-Abuse-To: abuse@dyndns.com (see http://www.mailhop.org/outbound/abuse.html for abuse reporting information) X-MHO-User: hogndos Message-ID: <44C66188.8010208@hogstrom.org> Date: Tue, 25 Jul 2006 14:23:04 -0400 From: Matt Hogstrom User-Agent: Thunderbird 1.5.0.4 (Macintosh/20060516) MIME-Version: 1.0 To: dev@geronimo.apache.org Subject: Re: [jira] Updated: (DAYTRADER-8) Small difference in sync order processing between Direct and EJB mode References: <10082151.1153751114367.JavaMail.jira@brutus> In-Reply-To: <10082151.1153751114367.JavaMail.jira@brutus> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Chris, thanks for the patch. One thing that would be helpful to me is when you attach the patch you name it with the JIRA as the first part of the patch. Its not required just makes my life a little easier when I've got a bunch of patches. Thanks! Matt Christopher James Blythe (JIRA) wrote: > [ http://issues.apache.org/jira/browse/DAYTRADER-8?page=all ] > > Christopher James Blythe updated DAYTRADER-8: > --------------------------------------------- > > Attachment: orderPatch.diff > > Sorry for the delay in posting this... I wanted to make sure I used the proper procedure for creating the patch before posting (thanks to Jason for his input). Also, tested this under load and there seemed to be no ill effects. > >> Small difference in sync order processing between Direct and EJB mode >> --------------------------------------------------------------------- >> >> Key: DAYTRADER-8 >> URL: http://issues.apache.org/jira/browse/DAYTRADER-8 >> Project: DayTrader >> Issue Type: Bug >> Components: EJB Tier >> Affects Versions: 1.1 >> Reporter: Christopher James Blythe >> Priority: Minor >> 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 100.0 >> 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 TradeDirect.java 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... >