Return-Path: Delivered-To: apmail-geronimo-user-archive@www.apache.org Received: (qmail 59558 invoked from network); 17 Jul 2006 16:14:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 17 Jul 2006 16:14:15 -0000 Received: (qmail 50449 invoked by uid 500); 17 Jul 2006 16:14:12 -0000 Delivered-To: apmail-geronimo-user-archive@geronimo.apache.org Received: (qmail 50428 invoked by uid 500); 17 Jul 2006 16:14:12 -0000 Mailing-List: contact user-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: user@geronimo.apache.org List-Id: Delivered-To: mailing list user@geronimo.apache.org Received: (qmail 50417 invoked by uid 99); 17 Jul 2006 16:14:12 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Jul 2006 09:14:12 -0700 X-ASF-Spam-Status: No, hits=1.7 required=10.0 tests=DNS_FROM_RFC_ABUSE,RCVD_IN_SORBS_WEB,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of linsun.unc@gmail.com designates 64.233.184.237 as permitted sender) Received: from [64.233.184.237] (HELO wr-out-0506.google.com) (64.233.184.237) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Jul 2006 09:14:09 -0700 Received: by wr-out-0506.google.com with SMTP id i30so545118wra for ; Mon, 17 Jul 2006 09:13:47 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:from:to:subject:date:message-id:mime-version:content-type:content-transfer-encoding:x-priority:x-msmail-priority:x-mailer:in-reply-to:x-mimeole:importance; b=q20pfMNFoPhLZ+z98I3q6Lu3qwFlSUxOB5deFbxM5CQbyOQzW0QG4+KY6AvYs/pv/ZhTtmPEsPctrYP6hzlmoli9cPGRPiuDIo8rzkyJp8RD26c7ourehrJcH6k5RSs2gKm+aBdD3p/L5ps4x9z2mOPgLyZ4ddmi0s2I0bzFQrA= Received: by 10.54.62.2 with SMTP id k2mr2176765wra; Mon, 17 Jul 2006 09:13:47 -0700 (PDT) Received: from LinT60 ( [129.33.49.251]) by mx.gmail.com with ESMTP id 44sm2141845wri.2006.07.17.09.13.46; Mon, 17 Jul 2006 09:13:46 -0700 (PDT) From: "Lin Sun" To: , Subject: RE: daytrader with Tranql Oracle XA resource adapter Date: Mon, 17 Jul 2006 12:13:11 -0400 Message-ID: <000501c6a9bb$fe537a60$81f22509@raleigh.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.6626 In-Reply-To: <6B7FFA6C-4C7A-42D4-A8DC-000667AC8739@yahoo.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 Importance: Normal X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi, Sorry to get back to you late... got busy on other stuff. Yes with the generic tranql wrapper, setting the commitBeforeAutocommit = to true would force the commit happen right away. However this commitBeforeAutocommit isn't available for tranql XA oracle wrapper. For Oracle wrapper's LocalMCF, I can just change: super(new OracleDataSource(), new OracleExceptionSorter(), false); to super(new OracleDataSource(), new OracleExceptionSorter(), true); However, for Oracle wrapper's XAMCF class, the parent class AbstractXADataSourceMCF's contructor only takes the first 2 parms. Here = are two options I can think of: =20 1st option: add the "boolean commitBeforeAutocommit" parm into the AbstractXADataSourceMCF's contructor, which will also require changes to = the localTransactionCommit method in ManagedXAConnection. Also all the = other vendor wrappers (db2, derby, mysql) will have to be updated. 2nd option: create the OracleManagedXAConnection class that extends AbstractManagedConnection. I would vote for 1st option as we have a quite big number of buggy = database vendors. What do you think? Lin -----Original Message----- From: David Jencks [mailto:david_jencks@yahoo.com]=20 Sent: Friday, July 07, 2006 12:39 PM To: user@geronimo.apache.org Subject: Re: daytrader with Tranql Oracle XA resource adapter Can you (or have you already) try using the generic tranql wrapper =20 with the oracle Driver class and set the commitBeforeAutocommit =20 property to true? This definitely _ought_ to make the commit happen =20 immediately: if it does, the oracle driver has a bug and we need to =20 modify the oracle wrapper to work around it. thanks david jencks On Jul 7, 2006, at 8:25 AM, Lin Sun wrote: > Hi there, > > Thanks for the pointer! IIUC, if the application uses =20 > connection.commit, > tranql will translate that as setautocommit(true) when the > commitBeforeAutoCommit is set to false. I believe this is what I =20 > have in > my environment. > > However, I still don't understand why it makes such a big =20 > difference for > Oracle. I have loaded daytrader on another J2EE application server > (WebSphere Application Server) and found out the same order =20 > committed to the > oracle database right away. With that, I would not categorize it =20 > as one of > the problematic drivers you mentioned before. > > Since derby and db2 XA adapter don't have this "delayed committing" =20 > problem > at all, I compared the two Tranql vendors' code with the Oracle =20 > vendor code. > Basically the vendor code contains the vendor specific MCF class =20 > that is > created based on the datasource from the vendor (for example, > OracleXADataSource). The MCF also sets/gets the datasource's =20 > different > properties (like databasename, username, password, servername, =20 > etc.). I > still don't get much clue as to why Oracle is special with Tranql. > > I think what I'll do is to come up with a simple application that =20 > can be > loaded into Eclipse and step into the connection.commit() code from =20 > Eclipse. > Too bad that I haven't figured out how to get daytrader running from > Eclipse.:-( > > Time to study the new plugin Sachin puts out.:-) > > Lin > > > > > > -----Original Message----- > From: Mario R=FCbsam [mailto:mr@coderesearch.com] > Sent: Thursday, July 06, 2006 2:37 PM > To: user@geronimo.apache.org > Subject: Re: daytrader with Tranql Oracle XA resource adapter > > Lin Sun wrote: >> Hi there, >> >> Do you know how to log the commits on the oracle side? I 'll be =20 >> happy to >> check that out if I know how to do it. > > I don't have a clue about the Oracle tools. But there must be some =20 > admin > tool to show the stats of the server, the connections, threads, ... > There is normally a transaction counter in these tools. Another way =20 > to find > it out is to look into the driver itself and figure out what is =20 > going on > in the setAutoCommit() method. But this is not legal in every =20 > country for > closed source interfaces. > >> >> I posted another note yesterday. The application was not using > AutoCommit. >> Instead connection.commit() is being used. > > That is correct, but to commit the local transaction TranQL use the > setAutoCommit(true); method, so if the JDBC driver is spec =20 > compliant the > transaction must be commited ... so far the theory, in the real world > some of the drivers don't do it for performance or whatever reasons. > > There was already a discussion about this problem here: > http://www.mail-archive.com/user@geronimo.apache.org/msg03450.html > > Thanks, > Mario > > > >> >> Lin >> >> -----Original Message----- >> From: Mario R=FCbsam [mailto:mr@coderesearch.com] >> Sent: Wednesday, July 05, 2006 4:59 PM >> To: user@geronimo.apache.org >> Subject: Re: daytrader with Tranql Oracle XA resource adapter >> >> I don't have experience with the Oracle Adapter. Can you log the =20 >> commits > on >> the Oracle side to see if any commits come through? I had a similar > problem >> with MaxDB and it seems that the transactions are not closed =20 >> because the >> JDBC driver for MaxDB did no commit on the connection if the =20 >> AutoCommit > was >> switched from false to true. The JDBC spec says if the value =20 >> changed the >> connection must be commited but the driver does not. Thats why I use >> CommitBeforeAutCommit now. >> Can you try to use the generic adapter to connect to Oracle and =20 >> see if it >> happens also? >> >> Thanks, >> Mario >> >> >> Lin Sun wrote: >>> Hi there, >>> >>> Thanks - I remember seeing your posting on CommitBeforeAutCommit =20 >>> setting >> in >>> the generic adapter. The CommitBeforeAutCommit setting is not =20 >>> avail in >>> the Oracle XA resource adapter. >>> >>> Lin >>> >>> -----Original Message----- >>> From: Mario R=FCbsam [mailto:mr@coderesearch.com] >>> Sent: Thursday, June 29, 2006 4:56 PM >>> To: user@geronimo.apache.org >>> Subject: Re: daytrader with Tranql Oracle XA resource adapter >>> >>> Hi, >>> >>> the CommitBeforeAutCommit setting in the generic adapter call >>> a commit on the local connection before it calls setAutoCommit=20 >>> (true). >>> Some JDBC drivers act not like specified in JDBC and don't call >>> a commit when the AutoCommit value changes with setAutoCommit(true) >>> so CommitBeforeAutCommit is a workaround to get the transaction >>> commited on these drivers (MySQL, MaxDB, PostgreSQL in some cases). >>> I don't know about the XA driver and Oracle but it could be a =20 >>> similar >>> problem. >>> >>> >>> -Mario >>> >>> >>> >>> Lin Sun wrote: >>>> Hi there, >>>> >>>> I have been playing with the daytrader with Tranql Oracle XA =20 >>>> resource >>>> adapter (tranql-connector-oracle-xa-1.1.rar). After I tweaked the >>>> plan a bit and I am able to get daytrader running well with oracle! >>>> >>>> One thing I noticed is that if I perform any trading activities =20 >>>> as a >>>> user (say uid:1, account_id 50), I get the message that my order =20 >>>> has >>>> been completed almost immediately. However, the order isn't =20 >>>> committed >>>> into the oracle database until quite a while. I don't know the =20 >>>> exact >>>> timing but seems to be over 20-30 minutes. >>>> >>>> Here is what I did to check if the order is recorded in the =20 >>>> database: >>>> >>>> Select * from orderejb where account_id=3D50; >>>> >>>> If the order is committed into the database, I would expect a =20 >>>> row that >>>> represents my previous order to be returned as the output of the =20 >>>> sql >>>> command. >>>> >>>> If I run the same scenario with db2 or derby, I can see my order >>>> recorded in the orderejb table immediately. >>>> >>>> I looked at the tranql oracle vendor code but I didn't see anywhere >>>> specifying the commit timing thing. The generic resource =20 >>>> adapter does >>>> offer an param called CommitBeforeAutCommit and by setting it to =20 >>>> true >>>> would force the commit to happen immediately. Can someone shed =20 >>>> some >>>> light on this? >>>> >>>> Thanks, Lin >>>> >>> >> >> >