[Pljava-dev] Compilation with both JDK 5 and JDK 6

Lists: pljava-dev
From: muhammad(dot)mansoor at enterprisedb(dot)com (Muhammad Mansoor)
To:
Subject: [Pljava-dev] Compilation with both JDK 5 and JDK 6
Date: 2010-06-16 20:35:31
Message-ID: AANLkTilWnA0n-fPNra-lDqyqEGw0Wkcv3Wkr9JSduEKt@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pljava-dev

Hi,

The attached patch takes care of the following issues.

1. It adds PostgreSQL 9.0 support.
2. It has the JDK support patch ( taken from *Petr Mich?lek original patch*
)
3. It enables PLjava to be compiled with both JDK 5 and JDK 6.

Enabling PLjava to compile with both JDK versions is little bit tricky. If
we have to compile with JDK 6 , we need to implement some extra JDBC API
methods, that are not there in the JDK 1.5. So by keeping the same code we
cannot compile it against both JDK versions.
So instead of having *org/postgresql/pljava/jdbc *directory, we will have
two directories i.e.

*org/postgresql/pljava/jdbc3 (have JDK 1.5 compliant implementation)*
*org/postgresql/pljava/jdbc4 ( have JDK 6 compliant implementation)*
*
*
When we run make it will generate a * **org/postgresql/pljava/jdbc *
directory* *based on target JDK. By default it will be JDK 1.5, if user
exports USE_JDK6 then will be build with JDK 6 compliant.
*
*

Thanks,
--
Syed Muhammad Mansoor
Architect
EnterpriseDB Corporation
The Enterprise Postgres Company
Website: http://www.enterprisedb.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pgfoundry.org/pipermail/pljava-dev/attachments/20100616/0396d224/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pljava_pg90_jdk5_jdk6.patch
Type: text/x-patch
Size: 1091747 bytes
Desc: not available
URL: <http://lists.pgfoundry.org/pipermail/pljava-dev/attachments/20100616/0396d224/attachment.bin>


From: books at ejurka(dot)com (Kris Jurka)
To:
Subject: [Pljava-dev] Compilation with both JDK 5 and JDK 6
Date: 2010-06-16 20:54:45
Message-ID: 4C193A15.7030409@ejurka.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pljava-dev

On 6/16/2010 1:35 PM, Muhammad Mansoor wrote:
> Hi,
>
> The attached patch takes care of the following issues.
>
> 1. It adds PostgreSQL 9.0 support.

The code in CVS already supports postgresql 9.0. You need to create
your patch from CVS, not from the 1.4.0 source release.

> 2. It has the JDK support patch ( taken from /Petr Mich?lek original
> patch/ )

Your patch has all the problems his does, tons of gratuitous whitespace
changes. You should not be reformatting/re-indenting unrelated code.

> 3. It enables PLjava to be compiled with both JDK 5 and JDK 6.

It does not appear to do this. A quick search through the patch doesn't
reveal any matches for JDBC4 or USE_JDK6.

Kris Jurka


From: muhammad(dot)mansoor at enterprisedb(dot)com (Muhammad Mansoor)
To:
Subject: [Pljava-dev] Compilation with both JDK 5 and JDK 6
Date: 2010-06-16 21:06:23
Message-ID: AANLkTimOohJVsPyjjugW6-DYe4MBuObvpYE1DOok5L4g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pljava-dev

On Wed, Jun 16, 2010 at 4:54 PM, Kris Jurka <books at ejurka.com> wrote:

> On 6/16/2010 1:35 PM, Muhammad Mansoor wrote:
>
>> Hi,
>>
>> The attached patch takes care of the following issues.
>>
>> 1. It adds PostgreSQL 9.0 support.
>>
>
> The code in CVS already supports postgresql 9.0. You need to create your
> patch from CVS, not from the 1.4.0 source release.
>

Sure I will do that.

>
> 2. It has the JDK support patch ( taken from /Petr Mich?lek original
>> patch/ )
>>
>
> Your patch has all the problems his does, tons of gratuitous whitespace
> changes. You should not be reformatting/re-indenting unrelated code.
>
>
> 3. It enables PLjava to be compiled with both JDK 5 and JDK 6.
>>
>
> It does not appear to do this. A quick search through the patch doesn't
> reveal any matches for JDBC4 or USE_JDK6.
>

These changes are there in the start of patch.

+ output := $(shell rm -rf
"src/java/pljava/org/postgresql/pljava/jdbc")
+
+ ifdef USE_JDK6
+ output := $(shell cp -rf
"src/java/pljava/org/postgresql/pljava/jdbc4"
"src/java/pljava/org/postgresql/pljava/jdbc")
+ else
+ output := $(shell cp -rf
"src/java/pljava/org/postgresql/pljava/jdbc3"
"src/java/pljava/org/postgresql/pljava/jdbc")
+ endif
+

I will make it more cleaner. Do you agree with the solution?

Thanks,

> Kris Jurka
>

--
Syed Muhammad Mansoor
Architect
EnterpriseDB Corporation
The Enterprise Postgres Company
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pgfoundry.org/pipermail/pljava-dev/attachments/20100616/235c7613/attachment.html>


From: books at ejurka(dot)com (Kris Jurka)
To:
Subject: [Pljava-dev] Compilation with both JDK 5 and JDK 6
Date: 2010-06-16 21:23:20
Message-ID: 4C1940C8.9020102@ejurka.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pljava-dev

On 6/16/2010 2:06 PM, Muhammad Mansoor wrote:
> On Wed, Jun 16, 2010 at 4:54 PM, Kris Jurka <books at ejurka.com
> <mailto:books at ejurka.com>> wrote:
>
> It does not appear to do this. A quick search through the patch
> doesn't reveal any matches for JDBC4 or USE_JDK6.
>
>
> These changes are there in the start of patch.

Sorry, I was looking at the wrong patch. I was looking at a version of
Petr's original patch. So my comments about whitespace changes are also
incorrect.

>
> + output := $(shell rm -rf
> "src/java/pljava/org/postgresql/pljava/jdbc")
> +
> + ifdef USE_JDK6
> + output := $(shell cp -rf
> "src/java/pljava/org/postgresql/pljava/jdbc4"
> "src/java/pljava/org/postgresql/pljava/jdbc")
> + else
> + output := $(shell cp -rf
> "src/java/pljava/org/postgresql/pljava/jdbc3"
> "src/java/pljava/org/postgresql/pljava/jdbc")
> + endif
> +
>
> I will make it more cleaner. Do you agree with the solution?
>

No, keeping two complete copies of slightly different code is not the
way to go. If you want to make pljava build against either JDK version
you need to provide JDBC4 classes extending JDBC3 classes like the
regular JDBC driver does so that only new JDBC4 code goes into the JDBC4
class, not a complete copy of the JDBC3 code. That's a significant
amount of work to do though and based on other comments on this list,
perhaps the best thing to do is to simply require JDK6 from here on out.

Kris Jurka


From: thomas at tada(dot)se (Thomas Hallgren)
To:
Subject: [Pljava-dev] Compilation with both JDK 5 and JDK 6
Date: 2010-06-16 22:45:50
Message-ID: 4C19541E.3080707@tada.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pljava-dev

On 06/16/2010 11:23 PM, Kris Jurka wrote:
> ... perhaps the best thing to do is to simply require JDK6 from here
> on out.
>
Yes, that approach has my vote. I doubt we make anyone happy by
continuing support for Java 1.5. If you're really conservative, chances
are you won't jump on a new release anyway.

- thomas