Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UG5Bb-0006Hs-6X for pgsql-jdbc@arkaria.postgresql.org; Thu, 14 Mar 2013 10:14:59 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UG5Ba-0008Jl-EC for pgsql-jdbc@arkaria.postgresql.org; Thu, 14 Mar 2013 10:14:58 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UG5BZ-0008Jg-Ih for pgsql-jdbc@postgresql.org; Thu, 14 Mar 2013 10:14:57 +0000 Received: from mail-ia0-x22b.google.com ([2607:f8b0:4001:c02::22b]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UG5BW-0004E2-Qq for pgsql-jdbc@postgresql.org; Thu, 14 Mar 2013 10:14:56 +0000 Received: by mail-ia0-f171.google.com with SMTP id z13so1917512iaz.16 for ; Thu, 14 Mar 2013 03:14:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:content-type:message-id:mime-version:subject:date :references:to:in-reply-to:x-mailer; bh=VgOATw8syv6msgGwKFC5tlUdn5KVgG8GB6LXfajPsJk=; b=MSNT5Y3+TCPk5hZTRttA0QtYcJURZ2gX4HFARuKAVCM7otipooZ4W07yfprJh84el2 xDh/kiLBgyiGK6U73wtZd6pUPIrSkVT9bXw1QSZWXlQSFBDsLmKza2VOH6Faud6C/ajr k3qkRY/RVknvSmpeAW106vgsRufptBAhqGVywgLc+gAccjahQ+n6ltK2g4EQfCvXj1h6 w6ln/K1E55ojIKj5yJ3bxsHf4sqD1jpQevpgP56w28t0UrhftJRXyX1VqkU4tjpI0QNO sO/Us//GLxtNaEaCK/h6hSkPi88T2clq2uTrZdwFxmXVl5q2V5dIL4WV85aixEd2TjtL DxgQ== X-Received: by 10.50.12.133 with SMTP id y5mr19941813igb.108.1363256093221; Thu, 14 Mar 2013 03:14:53 -0700 (PDT) Received: from [192.168.2.20] ([65.92.78.198]) by mx.google.com with ESMTPS id a3sm2742127igq.5.2013.03.14.03.14.51 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 14 Mar 2013 03:14:52 -0700 (PDT) From: Adib Saikali Content-Type: multipart/alternative; boundary="Apple-Mail=_D3E9C0AB-535C-4C6F-8733-8B96B62AA685" Message-Id: Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Subject: Re: A new JDBC driver... Date: Thu, 14 Mar 2013 06:14:20 -0400 References: <5141588D.9030405@2ndquadrant.com> To: "pgsql-jdbc@postgresql.org" In-Reply-To: <5141588D.9030405@2ndquadrant.com> X-Mailer: Apple Mail (2.1499) X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org --Apple-Mail=_D3E9C0AB-535C-4C6F-8733-8B96B62AA685 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 I agree on the importance of avoiding conflicts with the class path for = the application server. I think jarjar can easily solve such a problem = by embedding the required third party libraries in the final jar file in = such a way that conflicts with other versions of the same library does = not arise https://code.google.com/p/jarjar/ . The spring framework uses = jar jar to package internal versions of ASM and CGLIB, the = org.springframework. package hierarchy=20 =20 On 2013-03-14, at 12:56 AM, Craig Ringer wrote: > On 03/12/2013 09:19 AM, Kevin Wooten wrote: >>=20 >> * Asynchronous I/O engine provided by Netty >> * All connections share a single group of worker threads > That's going to cause serious issues on Java EE, especially when = unloading applications. Since you're on JDBC4 you can have init and = cleanup functions to manage the thread pool, but these are vital. I = asked about this re PgJDBC quite some time ago and got some good = information that's summarized here: >=20 > http://stackoverflow.com/q/8514725/398670 >=20 > Failure to properly shut the thread pool down when a servlet or = application is unloaded will cause classloader leaks, tending to lead to = PermGenSpace exhaustion errors and other problems. The driver will = probably need application-server-specific integration hooks too. >=20 > As for the "multiple JARs" converns, it's trivial to bundle = dependencies inside the JDBC driver jar. However, this can cause issues = if there's an incompatible version of the same library elsewhere on the = classpath. It's OK if you're on a modern application server like JBoss = AS 7 that isolates classloader chains, but it can be a real problem on = older platforms and standalone applications. For this reason both a = rollup version of the jar and a version without bundled libraries would = probably be needed, but this is trivial to produce from Maven. >=20 > Overall I think this is an intriguing idea, whether it proves to be an = ideas testbed or something that becomes appealing to adopt more = seriously. Congratulations on tackling it. >=20 > --=20 > Craig Ringer http://www.2ndQuadrant.com/ > PostgreSQL Development, 24x7 Support, Training & Services --Apple-Mail=_D3E9C0AB-535C-4C6F-8733-8B96B62AA685 Content-Transfer-Encoding: 7bit Content-Type: text/html; charset=windows-1252
I agree on the importance of avoiding conflicts with the class path for the application server.  I think jarjar can easily solve such a problem by embedding the required third party libraries in the final jar file in such a way that conflicts with other versions of the same library does not arise https://code.google.com/p/jarjar/ .  The spring framework uses jar jar to package internal versions of ASM and CGLIB, the org.springframework. package hierarchy 


 
On 2013-03-14, at 12:56 AM, Craig Ringer <craig@2ndquadrant.com> wrote:

On 03/12/2013 09:19 AM, Kevin Wooten wrote:

* Asynchronous I/O engine provided by Netty
* All connections share a single group of worker threads
That's going to cause serious issues on Java EE, especially when unloading applications. Since you're on JDBC4 you can have init and cleanup functions to manage the thread pool, but these are vital. I asked about this re PgJDBC quite some time ago and got some good information that's summarized here:

http://stackoverflow.com/q/8514725/398670

Failure to properly shut the thread pool down when a servlet or application is unloaded will cause classloader leaks, tending to lead to PermGenSpace exhaustion errors and other problems. The driver will probably need application-server-specific integration hooks too.

As for the "multiple JARs" converns, it's trivial to bundle dependencies inside the JDBC driver jar. However, this can cause issues if there's an incompatible version of the same library elsewhere on the classpath. It's OK if you're on a modern application server like JBoss AS 7 that isolates classloader chains, but it can be a real problem on older platforms and standalone applications. For this reason both a rollup version of the jar and a version without bundled libraries would probably be needed, but this is trivial to produce from Maven.

Overall I think this is an intriguing idea, whether it proves to be an ideas testbed or something that becomes appealing to adopt more seriously. Congratulations on tackling it.

-- 
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

--Apple-Mail=_D3E9C0AB-535C-4C6F-8733-8B96B62AA685--