Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 6556B1337A5D for ; Wed, 6 Apr 2011 23:54:51 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 34121-01 for ; Thu, 7 Apr 2011 02:54:43 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from www.postnewspapers.com.au (www.postnewspapers.com.au [173.230.139.50]) by mail.postgresql.org (Postfix) with ESMTP id B21A3133655C for ; Wed, 6 Apr 2011 23:54:43 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by www.postnewspapers.com.au (Postfix) with ESMTP id 82D25EB; Wed, 6 Apr 2011 22:54:44 -0400 (EDT) X-Virus-Scanned: amavisd-new at postnewspapers.com.au.com Received: from www.postnewspapers.com.au ([127.0.0.1]) by localhost (www.postnewspapers.com.au [127.0.0.1]) (amavisd-new, port 10024) with LMTP id uZ4G56RK42Lf; Wed, 6 Apr 2011 22:54:43 -0400 (EDT) Received: from mail.postnewspapers.com.au (ppp171-128.static.internode.on.net [150.101.171.128]) by www.postnewspapers.com.au (Postfix) with ESMTP id 7C9F02D; Wed, 6 Apr 2011 22:54:43 -0400 (EDT) Received: from [10.0.0.53] (wallace.localnet [10.0.0.53]) by mail.postnewspapers.com.au (Postfix) with ESMTP id 65FB3AEEE3; Thu, 7 Apr 2011 10:54:42 +0800 (WST) Message-ID: <4D9D2772.5080501@postnewspapers.com.au> Date: Thu, 07 Apr 2011 10:54:42 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.15) Gecko/20110307 Thunderbird/3.1.9 MIME-Version: 1.0 To: John Lister CC: pgsql-jdbc@postgresql.org Subject: Re: Recommended resource type and settings for J2EE/Glassfish connection pool References: <02A1185E68DA479596BD9F56FD0CB637@squarepi.com> In-Reply-To: <02A1185E68DA479596BD9F56FD0CB637@squarepi.com> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201104/44 X-Sequence-Number: 21770 On 07/04/11 05:51, John Lister wrote: > Hi, what is the recommended/supported/best resource type to use with a > J2EE server eg Glassfish for the connection pool? I'm currently using > javax.sql.ConnectionPoolDataSource with PGSimpleDataSource as the class, > however I would have thought an XADataSource would be better? Do you need XA? If you're not doing distributed transactions and using a distributed transaction manager, the simple data source should be more than fine. I'd avoid using the dumb pooling datasource built into the JDBC driver. You're doing the right thing by using your container's pooling. I'm using a glassfish-resources.xml like this: which is being deployed using 'asadmin add-resources'. > Also, what settings/parameters would anyone recommend either to the > connection pool or the driver itself such as statement caching? Don't stress about it until it becomes a problem. You can tune those things based on performance measurements once your app is complete enough that you can profile and load-test it. Trying to do so blind is probably just premature "optimization". -- Craig Ringer