Re: JBoss w/int8 primary keys in postgres ...

From: Paul Thomas <paul(at)tmsl(dot)demon(dot)co(dot)uk>
To: James Robinson <jlrobins(at)socialserve(dot)com>
Cc: "pgsql-jdbc (at) postgresql (dot) org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: JBoss w/int8 primary keys in postgres ...
Date: 2003-09-09 13:32:08
Message-ID: 20030909143208.C3136@bacon
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On 09/09/2003 01:57 James Robinson wrote:
>
> On Monday, September 8, 2003, at 10:18 AM, Paul Thomas wrote:
>
>> As the JDBC driver is designed to work for current + many past releases
>> of PG, modifications along the line I've proposed would also help users
>> of older versions of PG and provide fairly consistent behavior across
>> versions.
>
> I'm certainly not against such a proposal, making our PreparedStatements
> smarter, but it would not help out in the JBossCMP case, nor would it
> help out any other frontend, including the CLI psql client, in that:
>
> create table test (
> pk int8 not null primary key,
> name text;
> );
> copy into test values ( .... )
>
> ...
> select name from test where id = 42;
>
> just doesn't do what you would reasonably expect.

With the proposed modifications to the JDBC driver enabled

PreparedStatement pstmt = con.prepareStatement("select name from test
where id = ?");
pstmt.setLong(1, 42);
pstmt.executeQuery();

would actually produce:

select name from test where id = 42::int8

which _would_ cause an index to be used on your table.
>>> CMP will be the death of us all.
>>
>> No, just those who choose to go the EJB route. My preference is DAO.
>
> I am enslaved to entity beans for now, and am ignorant for the most part
> regarding the philosophies of both JDO and DAO. How would DAO get around
> this issue?

Take a look at the sample Adventure application on java.sun.com. It uses
DAOs.

HTH

--
Paul Thomas
+------------------------------+---------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for the Smaller
Business |
| Computer Consultants |
http://www.thomas-micro-systems-ltd.co.uk |
+------------------------------+---------------------------------------------+

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Rod Taylor 2003-09-09 13:38:41 Re: JBoss w/int8 primary keys in postgres ...
Previous Message Nick Fankhauser 2003-09-09 12:24:57 Re: postgres- connection refuse