Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 66954 invoked from network); 29 Oct 2003 04:19:56 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 29 Oct 2003 04:19:56 -0000 Received: (qmail 53510 invoked by uid 500); 29 Oct 2003 04:19:32 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 53400 invoked by uid 500); 29 Oct 2003 04:19:32 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 53387 invoked from network); 29 Oct 2003 04:19:32 -0000 Received: from unknown (HELO hotmail.com) (64.4.18.201) by daedalus.apache.org with SMTP; 29 Oct 2003 04:19:32 -0000 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Tue, 28 Oct 2003 20:19:42 -0800 Received: from 61.11.81.67 by law12-oe66.law12.hotmail.com with DAV; Wed, 29 Oct 2003 04:19:41 +0000 X-Originating-IP: [61.11.81.67] X-Originating-Email: [antonypaul24@hotmail.com] From: "Antony Paul" To: "Jakarta Commons Users List" References: <9BAE99905FCF684D91F63E1439475FBA0F6A64EE@sydmsg1.int.f2.com.au> Subject: Re: DBCP : some questions. Date: Wed, 29 Oct 2003 09:55:50 +0530 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4927.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4927.1200 Message-ID: X-OriginalArrivalTime: 29 Oct 2003 04:19:42.0144 (UTC) FILETIME=[E0307C00:01C39DD3] X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Thank you for the reply. For transaction support previously I was turning the AutoCommit off and then the connection is put in the session and forwarded to next JSP/servlet and closed the connection after use. Is it the right method. Or there is any better method. In DBCP example using JNDI this code is used to get connection. Context initContext = new InitialContext(); Context envContext = (Context)initContext.lookup("java:/comp/env"); DataSource ds = (DataSource)envContext.lookup("jdbc/Test"); Connection conn = ds.getConnection(); putting this code in every page,servlet and bean is not a good idea(lot of typing and importing all class files). Any better method for doing it. Antony Paul putting this code in ----- Original Message ----- From: "Brett Porter" To: "'Jakarta Commons Users List'" Sent: Wednesday, October 29, 2003 2:56 AM Subject: RE: DBCP : some questions. > > 1. Is it possible to use DBCP in other application > > servers? > > Yes, if they provide a way to use a custom factory to create a data source. > I don't know of any specific examples, but you should look into the > documentation for that application server. I personally haven't tried it, > and I would say to stick to the connection pooling provided by your > application server if it does what you need already. You shouldn't need to > be using DBCP directly, its all internal to Tomcat. > > > 2. How to handle transactions. Some pages are using > > transactions and others not. > > As you previously did. DBCP doesn't do anything to specific transactions, > except that you might want to set the defaultAutoCommit parameter to false > (Although you can do that on obtaining the connection as well. > > - Brett > --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org