openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ryosuke Iwata (JIRA)" <>
Subject [jira] Updated: (OPENJPA-427) PostgresDictionary should set "63" as "maxAutoAssignNameLength".
Date Sun, 04 Nov 2007 10:35:51 GMT


Ryosuke Iwata updated OPENJPA-427:

    Attachment: mychanges.patch

I created and attached below a patch to clarify what I'm thinking is to be done to fix this
issue : it's simply add "maxAutoAssignNameLength = 63;" to the codes in the constructor of

I've not tested the patch, because currently I don't have any environment to build OpenJPA.
I expect that my fix will work, because, according to the source comment,  PostgresDictionary
uses getGeneratedKeySequenceName() which depends on the value of "maxAutoAssignNameLength"
to obtain last generated key value.

And, I'm not sure if the value "63" is suitable for "maxAutoAssignNameLength".

I hope someone would fix if there's something wrong in my patch... m(_ _)m

Thank you.

> PostgresDictionary should set "63" as "maxAutoAssignNameLength".
> ----------------------------------------------------------------
>                 Key: OPENJPA-427
>                 URL:
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: sql
>    Affects Versions: 1.0.0, 1.1.0
>         Environment: PostgreSQL 8.1.
>            Reporter: Ryosuke Iwata
>            Priority: Blocker
>         Attachments: mychanges.patch
> PostgresDictionary should set "63" (or something correct) as "maxAutoAssignNameLength",
in order to let DBDictionary#getGeneratedKeySequenceName() generate correct names for IDENTITY
> OpenJPA trims IDENTITY sequence names longer than 32 characters, while PostgreSQL uses
longer names for BIGSERIAL sequences. So, persisting entities with @Id column with GenerationType.IDENTITY
often results in a database error such as :
>         org.apache.openjpa.lib.jdbc.ReportingSQLException: ERROR: relation "x_school_membershi_entityid_seq"
does not exist {prepstmnt 2398193 SELECT CURRVAL(X_SCHOOL_TRANSFER_entityId_SEQ')} [code=0,
> The followings are the examples. "OK"s are the sequence names which PostgreSQL uses.
"NG"s are those which OpenJPA attempts to use.
> Ex.1 -
>         BIGSERIAL Column : ENTITYID
> Ex.2 -
>         Table : X_SCHOOL_MEMBERSHIP
>         BIGSERIAL Column : ENTITYID

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message