pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedJDBC driver with JPA handling identities incorrectly
2+ messages / 2 participants
[nested] [flat]
* JDBC driver with JPA handling identities incorrectly
@ 2009-08-27 12:01 Stephen Nelson <stephen@eccostudio.com>
2009-08-27 14:04 ` Re: JDBC driver with JPA handling identities incorrectly Oliver Jowett <oliver@opencloud.com>
0 siblings, 1 reply; 2+ messages in thread
From: Stephen Nelson @ 2009-08-27 12:01 UTC (permalink / raw)
To: pgsql-jdbc
Hi,
I created a thread for this at http://stackoverflow.com/questions/1333596/postgresql-identity-in-jpa-single-table-hierarchy
which details the full environment and code I was attempting to run.
Briefly my environment is:
PostgreSQL 8.3
JDBC Driver postgresql-8.4-701.jdbc4
This resulted in an error when using a JPA generation type of IDENTITY
in a single table inheritance hierarchy. The discriminator was a
String but was trying to be parsed as a long by the framework. For
demo purposes when using a String that was a parseable value e.g. 123
the error did not occur but the framework believed the discriminator
value was the primary key.
I switched the JDBC driver to postgresql-8.3-605.jdbc4.jar and the
problem doesn't seem to occur.
I'm running Java 6 so believed the latest driver to be the correct one
even though I'm not running the 8.4 server.
Please let me know if you need any further information or if I can
assist in fixing the issue.
Kind regards,
Stephen Nelson
stephen@eccostudio.com
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: JDBC driver with JPA handling identities incorrectly
2009-08-27 12:01 JDBC driver with JPA handling identities incorrectly Stephen Nelson <stephen@eccostudio.com>
@ 2009-08-27 14:04 ` Oliver Jowett <oliver@opencloud.com>
0 siblings, 0 replies; 2+ messages in thread
From: Oliver Jowett @ 2009-08-27 14:04 UTC (permalink / raw)
To: Stephen Nelson <stephen@eccostudio.com>; +Cc: pgsql-jdbc
Stephen Nelson wrote:
> Hi,
>
> I created a thread for this at
> http://stackoverflow.com/questions/1333596/postgresql-identity-in-jpa-single-table-hierarchy
> which details the full environment and code I was attempting to run.
>
> Briefly my environment is:
>
> PostgreSQL 8.3
> JDBC Driver postgresql-8.4-701.jdbc4
>
> This resulted in an error when using a JPA generation type of IDENTITY
> in a single table inheritance hierarchy. The discriminator was a String
> but was trying to be parsed as a long by the framework. For demo
> purposes when using a String that was a parseable value e.g. 123 the
> error did not occur but the framework believed the discriminator value
> was the primary key.
>
> I switched the JDBC driver to postgresql-8.3-605.jdbc4.jar and the
> problem doesn't seem to occur.
>
> I'm running Java 6 so believed the latest driver to be the correct one
> even though I'm not running the 8.4 server.
>
> Please let me know if you need any further information or if I can
> assist in fixing the issue.
Hard to say what is happening here without knowing what JDBC calls your
JPA layer actually makes.
Do you have a plain JDBC testcase that shows the problem?
-O
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2009-08-27 14:04 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2009-08-27 12:01 JDBC driver with JPA handling identities incorrectly Stephen Nelson <stephen@eccostudio.com>
2009-08-27 14:04 ` Oliver Jowett <oliver@opencloud.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox