Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Z9Sah-0002AE-Bx for pgsql-jdbc@arkaria.postgresql.org; Mon, 29 Jun 2015 06:30:51 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1Z9Sag-0008St-HZ for pgsql-jdbc@arkaria.postgresql.org; Mon, 29 Jun 2015 06:30:50 +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 1Z9Saf-0008Sm-BM for pgsql-jdbc@postgresql.org; Mon, 29 Jun 2015 06:30:49 +0000 Received: from mail-wi0-f170.google.com ([209.85.212.170]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1Z9SaX-0001jV-Ho for pgsql-jdbc@postgresql.org; Mon, 29 Jun 2015 06:30:48 +0000 Received: by wicgi11 with SMTP id gi11so62304424wic.0 for ; Sun, 28 Jun 2015 23:30:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type; bh=YPnkh6XabuKy+8v7ZlNxO5JSUqhO0o7qEd25vlhrXis=; b=BCd/kVKJZDVlGeTK4Cizff6oRAG9TTntiYN1/ycRuzRfwCx9J4NHDg/Rww7+lBsDwC j809A9pAxFvRLhqleaXNtLkMAXbHl/5+iWHl9C1vjkpwfRfWxbEeFGSXhPcJZ1KZkvmV grd04C8GUqbL05stRMWbeMEY36ms+Ku9sUSF6Eg7RI/TA71T5liqsuG2nij11EQpSxTb CTYVsz9WxWWhDyZhCGWTKYBRzZQF8i2tdXt4woPleJT+SrVcxKJAFHJIfSP3dhWC8wfC ZgDf/vUzuY+FD1wnsUcxNvWSRbp0GNsmgZ0wAPnIbtlPzAXkTvyh0dfG2iJQa+AokHwS PVFA== X-Gm-Message-State: ALoCoQkJhjsF84+LFdi80ngOVuuBVWIc7CSjukOr1GoWzgt5bgoEQp1+UYUbZu0gp2bIKl+onOzw X-Received: by 10.194.142.146 with SMTP id rw18mr24416834wjb.110.1435559439816; Sun, 28 Jun 2015 23:30:39 -0700 (PDT) Received: from [192.168.43.95] ([31.4.238.48]) by mx.google.com with ESMTPSA id lf4sm62537781wjb.42.2015.06.28.23.30.37 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 28 Jun 2015 23:30:39 -0700 (PDT) Message-ID: <5590E60C.8090503@8Kdata.com> Date: Mon, 29 Jun 2015 08:30:36 +0200 From: =?UTF-8?B?w4FsdmFybyBIZXJuw6FuZGV6IFRvcnRvc2E=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Sehrope Sarkuni , Dave Cramer CC: Christopher BROWN , List Subject: Re: SQLJSON References: <558ED5A6.4070500@8Kdata.com> <002701d0b104$114cdd60$33e69820$@eu> <558F15C7.5060309@8Kdata.com> <001a01d0b126$1ab09c80$5011d580$@eu> <558F214A.2090802@8Kdata.com> <002901d0b183$53e541b0$fbafc510$@eu> <558FC1ED.3000401@8Kdata.com> <001401d0b187$fe63d080$fb2b7180$@eu> <558FC5AD.3040908@8Kdata.com> <559054D2.9000601@8Kdata.com> In-Reply-To: Content-Type: multipart/alternative; boundary="------------090803020900070801040107" X-Pg-Spam-Score: -0.3 (/) 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 This is a multi-part message in MIME format. --------------090803020900070801040107 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 28/06/15 22:54, Sehrope Sarkuni wrote: > On Sun, Jun 28, 2015 at 4:35 PM, Dave Cramer >wrote: > > On 28 June 2015 at 16:32, Christopher BROWN > wrote: > > Embedding the API will cause classloader conflicts for those > who already have the API in their classpath. Same goes for > embedding the reference implementation. > > The API, or the implementation ??? > > > Both. Embedding dependencies is mildly convenient for someone getting > started with something but royally inconvenient for someone with a > complicated environment. Dependency management systems like Maven > handle this pretty well but even they can't deal with situations where > classes are embedded in a dependency (ex: javax.json.* embedded within > the PG JDBC driver). Sehrope, what do you mean by Maven can't deal with embedded classes in the dependencies? It very well can :) The only problem would be, as stated in a previous email, if different versions of the same class would collide on transitive dependencies. But at least for the JSR353 IMHO that's extremely unlikely --and not worth to engineer around it. > The service loader API can be problematic for OSGi users, as > it isn't very helpful for hot reloading of classes. The > PostgreSQL JDBC driver currently works well in such > environments, it would be unfortunate to lose that advantage > through an attempt to help out another category of users. > > This shouldn't be the only way of selecting an implementation, > and bundling a given version of the API + RI shouldn't be the > only build option. I'm certainly not against making this Just > Work, but here there's a possibility that all this extra stuff > could actually cause things to break . > > so how do we make it "Just Work" ? > > I don't think there's a way to do this without breaking backward > compatibility. > > You definitely can't rely on specific dependencies on the classpath > that legacy users will not have. Bundling the dependencies doesn't > work either as it'd clobber existing ones on the classpath. Making > things dynamic/pluggable may be option for internal implementations > but it breaks anything with the required dependencies in the method > signature. That means we could have code that dynamically picks a JSON > parser and uses it internally, but we can't have a getJsonValue() > method on a public PGResultSet interface as the class wouldn't even > load properly on an older JVM[1]. > > In a lot of ways this is similar to the other thread we had about > dropping support for older JVMs. To natively support new features > (like a native getJsonValue()) we'd need to specify a min JDK version. JSR353 targets 1.6+. So if by older you mean 4 or 5 then yes, it won't be supported. > > At this point I think we have to bite bullet and either drop support > for older versions (not likely) or offer multiple versions of the > driver. The latter could make modern assumptions about the > classpath/environment to support new features natively. That could > include JsonValue and the new Java 8 date/time types. +1 to drop support for less than 1.6. Or at least, create different versions (but that is indirectly happening now, with different JDBC API levels). But not adding as of today JsonValue to a method signature because we want to retain compatibility with 1.5 or less is not something our users would understand. Regards, Álvaro -- Álvaro Hernández Tortosa ----------- 8Kdata --------------090803020900070801040107 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
On 28/06/15 22:54, Sehrope Sarkuni wrote:
On Sun, Jun 28, 2015 at 4:35 PM, Dave Cramer <pg@fastcrypt.com> wrote:
On 28 June 2015 at 16:32, Christopher BROWN <brown@reflexe.fr> wrote:

Embedding the API will cause classloader conflicts for those who already have the API in their classpath.  Same goes for embedding the reference implementation.

The API, or the implementation ???  

Both. Embedding dependencies is mildly convenient for someone getting started with something but royally inconvenient for someone with a complicated environment. Dependency management systems like Maven handle this pretty well but even they can't deal with situations where classes are embedded in a dependency (ex: javax.json.* embedded within the PG JDBC driver).
    Sehrope, what do you mean by Maven can't deal with embedded classes in the dependencies? It very well can :) The only problem would be, as stated in a previous email, if different versions of the same class would collide on transitive dependencies. But at least for the JSR353 IMHO that's extremely unlikely --and not worth to engineer around it.

The service loader API can be problematic for OSGi users, as it isn't very helpful for hot reloading of classes.  The PostgreSQL JDBC driver currently works well in such environments, it would be unfortunate to lose that advantage through an attempt to help out another category of users.

This shouldn't be the only way of selecting an implementation, and bundling a given version of the API + RI shouldn't be the only build option. I'm certainly not against making this Just Work, but here there's a possibility that all this extra stuff could actually cause things to break .

so how do we make it "Just Work" ?
 
I don't think there's a way to do this without breaking backward compatibility.

You definitely can't rely on specific dependencies on the classpath that legacy users will not have. Bundling the dependencies doesn't work either as it'd clobber existing ones on the classpath. Making things dynamic/pluggable may be option for internal implementations but it breaks anything with the required dependencies in the method signature. That means we could have code that dynamically picks a JSON parser and uses it internally, but we can't have a getJsonValue() method on a public PGResultSet interface as the class wouldn't even load properly on an older JVM[1].

In a lot of ways this is similar to the other thread we had about dropping support for older JVMs. To natively support new features (like a native getJsonValue()) we'd need to specify a min JDK version.

    JSR353 targets 1.6+. So if by older you mean 4 or 5 then yes, it won't be supported.

At this point I think we have to bite bullet and either drop support for older versions (not likely) or offer multiple versions of the driver. The latter could make modern assumptions about the classpath/environment to support new features natively. That could include JsonValue and the new Java 8 date/time types.
+1 to drop support for less than 1.6. Or at least, create different versions (but that is indirectly happening now, with different JDBC API levels). But not adding as of today JsonValue to a method signature because we want to retain compatibility with 1.5 or less is not something our users would understand.

    Regards,

    Álvaro

-- 
Álvaro Hernández Tortosa


-----------
8Kdata

--------------090803020900070801040107--