Return-Path: Delivered-To: apmail-xml-cocoon-dev-archive@xml.apache.org Received: (qmail 68125 invoked by uid 500); 14 May 2003 12:45:16 -0000 Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: cocoon-dev@xml.apache.org Delivered-To: mailing list cocoon-dev@xml.apache.org Received: (qmail 67914 invoked from network); 14 May 2003 12:45:13 -0000 Received: from smtp017.mail.yahoo.com (216.136.174.114) by daedalus.apache.org with SMTP; 14 May 2003 12:45:13 -0000 Received: from user-0calai6.cable.mindspring.com (HELO yahoo.com) (johnsbrn@24.170.170.70 with plain) by smtp.mail.vip.sc5.yahoo.com with SMTP; 14 May 2003 12:45:13 -0000 Date: Wed, 14 May 2003 08:45:10 -0400 Subject: Re: transactions in the SQLTransformer Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v552) From: Brian Johnson To: cocoon-dev@xml.apache.org Content-Transfer-Encoding: 7bit In-Reply-To: <3EC22C64.2010601@nada.kth.se> Message-Id: X-Mailer: Apple Mail (2.552) X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Interesting.... maybe it's an issue with XA vs. non-XA transactions. I haven't had the problem you describe with XA transactions. In my application, you would have to associate the connection with the session, since the SQLTransformer is used multiple times in the pipeline in a single transaction. What database are you using? I believe that transactions are associated with a particular thread, and since a second user request will always come in on a different thread, it shouldn't be an issue. Am I missing something? Is there a difference between XA and non-XA on this issue? Am I just wrong and simply haven't noticed the issue in my app? I wrote a test case for my application that I believe addresses the issue, but maybe I need to increase the number of concurrent connections to properly test it. Thanks. Brian On Wednesday, May 14, 2003, at 07:45 AM, Daniel Fagerstrom wrote: > Brian Johnson wrote: > > > It should not be necessary to use the same connection for each query. > > Even if you are not using a J2EE datasource, Cocoon maintains a pool > > of database connections, so the connection is not actually closed > > after each query. Transaction processing does not require a single > > database connection, the only thing it requires is a single thread. > > I have tried this, IIRC it lead to some highly undesirable things like > that an SQLTransformer instance that was serving another users request > got a connection with an opened transaction from the pool and closed > it. > As soon as you have more than one user it is very dangerous to return a > connection with an opened transaction to the pool, you might be lucky > and get the same connection when you executes the rest of the queries > in > the transaction. But this "luck" is more likely when you as a developer > is the only user. > > Anyhow as I wrote earlier in this thread I have written a patch > http://issues.apache.org/bugzilla/show_bug.cgi?id=16718 that solve the > problem, and also increase the efficiency of the SQLTransformer, and > that works without any problems in our production systems since a > couple > of mounths. I would be very thankful if somebody with commit right > could > find the time to apply the patch :) > > /Daniel > > >