Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZdnD7-0007Kb-1p for pgsql-jdbc@arkaria.postgresql.org; Sun, 20 Sep 2015 22:35:53 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZdnD6-0001Ft-B7 for pgsql-jdbc@arkaria.postgresql.org; Sun, 20 Sep 2015 22:35:52 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZdnCb-0000hT-Av for pgsql-jdbc@postgresql.org; Sun, 20 Sep 2015 22:35:21 +0000 Received: from st11p05im-asmtp001.me.com ([17.172.109.149]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1ZdnCX-0008S3-1U for pgsql-jdbc@postgresql.org; Sun, 20 Sep 2015 22:35:19 +0000 Received: from [192.168.100.42] (ip70-162-254-121.ph.ph.cox.net [70.162.254.121]) by st11p05im-asmtp001.me.com (Oracle Communications Messaging Server 7.0.5.35.0 64bit (built Mar 31 2015)) with ESMTPSA id <0NUZ00QLJYQ89620@st11p05im-asmtp001.me.com> for pgsql-jdbc@postgresql.org; Sun, 20 Sep 2015 22:34:58 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2015-09-20_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 kscore.is_bulkscore=0 compositescore=0.036188096552539 phishscore=0 kscore.is_spamscore=0 rbsscore=0.036188096552539 recipient_to_sender_totalscore=0 spamscore=0 urlsuspectscore=0.036188096552539 adultscore=0 kscore.compositescore=2.83660595012947e-10 circleOfTrustscore=0 suspectscore=0 recipient_domain_to_sender_totalscore=0 bulkscore=0 recipient_domain_to_sender_domain_totalscore=0 recipient_to_sender_domain_totalscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1412110000 definitions=main-1509200410 Content-type: text/plain; charset=windows-1252 MIME-version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: allowing *inheritance* from pgjdbc or pgjdbc-ng ? From: Kevin Wooten In-reply-to: <55FF0C3A.6070804@anastigmatix.net> Date: Sun, 20 Sep 2015 15:34:56 -0700 Cc: pgsql-jdbc@postgresql.org, pljava-dev@lists.pgfoundry.org Content-transfer-encoding: quoted-printable Message-id: References: <55FF0C3A.6070804@anastigmatix.net> To: Chapman Flack X-Mailer: Apple Mail (2.2104) X-Pg-Spam-Score: -2.6 (--) 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 I would certainly entertain any changes to pgjdbc-ng to allow this as long = as it is properly decoupled and doesn=92t cause loads of changes into the d= river main. The ng driver was designed with pluggable protocols as well. So in either c= ase it seems implementing a new implementation of the protocol with the SPI= is the obvious direction to go and should leave the the main driver code u= nchanged. > On Sep 20, 2015, at 12:42 PM, Chapman Flack wrote: >=20 > Hi, >=20 > I've been putting some work recently into PL/Java. >=20 > It provides a direct JDBC interface for Java code on the backend, > using SPI under the hood. The JDBC code was clearly copy/pasted from > pgjdbc long ago, then adapted to the needs of running on the backend. >=20 > I'll be preaching to the choir if I say upkeep of a JDBC interface > is a lot of work. Easy or hard new workloads at any time can be dumped > onto the project from either end. New PostgreSQL release? New protocol > details, metadata queries, etc., have to be worked out, and somebody > has to do that. New Java release? New JDBC interfaces to be implemented > and figured out, and somebody has to do that. And with the copied/ > pasted code, somebody has to do that for pgjdbc *and* somebody has > to do it for PL/Java, and I'm sure neither project has so many > committers as to say "hey, no problem, we love duplicating work, > gives us something to do!" >=20 > What I would really like to experiment with is how possible it > might be for PL/Java to provide JDBC by *inheritance* from pgjdbc > (or pgjdbc-ng) instead of by copy and paste. Add a dependency to > the Maven pom and it's off to the races. >=20 > I'm sure the devil is in all the little things I can't think of > up front, but in dreamland it basically works by having some way > to instantiate a Jdbc...Connection with a different underlying > ProtocolConnection subclass (one that uses SPI instead of v2 or v3, > returns TRANSACTION_OPEN from getTransactionState() at all times, > returns its own kind of QueryExecutor, etc.). I'm using the pgjdbc > names here. >=20 > Whether to try with pgjdbc or pgjdbc-ng, I don't know. The first > might be easier because of the original code similarity. The second > might be easier because the code is new and streamlined. It looks like > in either case, I would need to submit a few pull requests upstream > just to make it possible to instantiate and subclass the necessary > things with a different connection subclass. >=20 > If I made some pull requests of that sort, would you (pgjdbc or > pgjdbc-ng) be generally open to considering them? That's my basic > question #1 here. >=20 > If the idea works, it could increase the chance we can *share* effort > on improvements that benefit two projects, instead of just going on > making the same improvements twice. >=20 > Another plus on the PL/Java side could be that, if someone had backend > code with some reason to connect to another database, or have a side > connection to the same one, the same JDBC implementation would already > be there, just using a remote connection URL instead of > jdbc:default:connection, and the behavior would be as consistent as > possible given the different connection properties. >=20 > After question #1 I may have some smaller ones, one I can think of > is about logging. PL/Java and pgjdbc-ng both use java.util.logging, > pgjdbc has a homegrown org.postgresql.core.Logger, for historical > reasons I'm guessing? Would converging on the java.util.logging > API be a thinkable thought, or just way too much work, or > objected to for some philosophical or technical reason? >=20 > I guess that's enough for now, thanks for your attention. >=20 > -Chap --=20 Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc