Return-Path: Mailing-List: contact cocoon-users-help@xml.apache.org; run by ezmlm Delivered-To: mailing list cocoon-users@xml.apache.org Received: (qmail 49550 invoked from network); 9 Jan 2001 20:56:09 -0000 Received: from fw.infoplanning.net (HELO infoplanning.com) (@209.8.58.131) by h31.sny.collab.net with SMTP; 9 Jan 2001 20:56:09 -0000 Received: (qmail 19670 invoked from network); 9 Jan 2001 21:03:08 -0000 Received: from unknown (HELO apache.org) (192.168.0.189) by inet with SMTP; 9 Jan 2001 21:03:08 -0000 Message-ID: <3A5B7A00.1040501@apache.org> Date: Tue, 09 Jan 2001 15:52:16 -0500 From: Berin Loritsch User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; 0.6) Gecko/20001205 X-Accept-Language: en MIME-Version: 1.0 To: cocoon-users@xml.apache.org Subject: Re: cocoon and database Connection References: <004f01c07a64$8fad6e40$86c909c0@imagineny.com> <20010109130444.A2382@plan9ws1.uct.usm.maine.edu> <3A5B5BD9.7060007@apache.org> <000901c07a6f$6ebbe4e0$86c909c0@imagineny.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N Piyush Sheth wrote: > That's what one would expect of database connection( as done in Cocoon2 ) > management. > > Is it possible to use my own database connection pool( such that it starts > when cocoon starts ) and ends once cocoon's > lifetime ends ? If yes how can it be done with cocoon-1.8/2 ? > > piyush. The short answer is yes. The long answer depends on if the pooling is yours or not. Cocoon 2 defines a DataSourceComponent that lives in the Component heirarchy of Cocoon. It's only method is getConnection(). If you want to use your own pooling, then you would create an implementation of the DataSourceComponent that calls your pool. If you are wanting to use normal JDBC connections, then the Component is already there. You only have to specify the settings in the cocoon.xconf file. If you want to use a J2EE Application Server's pooling, then the DataSourceComponent for that has not yet been written. It is in my todo list for the (very) near future. For Cocoon 1.8+ it uses a separate project that pools the Connection objects for you--but it only works for certain JDBC drivers (the Cocoon 2 version is much more generic). You will have to ask someone more familiar with the Cocoon 1.8+ code how that would be done for you. > > ----- Original Message ----- > From: Berin Loritsch > To: > Sent: Tuesday, January 09, 2001 1:43 PM > Subject: Re: cocoon and database Connection > > > >> Matthew Cordes wrote: >> >> >>> Cocoon itself does nothing, but you can use the turbine connection >>> pool to have a pool of persistent connections (see your >>> cocoon.properties file). In lieu of that you'd need to make at least >>> a connection per page (use the pool). >> >> In Cocoon 2, there is a pooled Jdbc Connection facility. >> You specify your connection and give it a name in the >> cocoon.xconf file (look in the supplied version on how >> to do that), and then reference it with the >> tag or tag. >> >> The connections are pooled and kept open until the system >> shuts down. It reclaims connections that are not used >> when they are no longer needed. >> >> >>> -matt >>> >>> On Tue, Jan 09, 2001 at 12:49:48PM -0500, Piyush Sheth wrote: >>> >>> >>>> How does cocoon manage database connection ? >>>> Does it establish database connection everytime a document( obviously >>> > it has > >>>> some fields from database ) >>>> is requested or the connection is persists once cocoon is initialized >>> > and > >>>> until it is shutdown. >>>> >>>> >>>> Piyush.