Re: BUG #3920: sequence not generated for postgres using toplink jpa

From: "Arun ViswanathanChandrika" <Arun(dot)ViswanathanChandrika(at)ust-global(dot)com>
To: <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #3920: sequence not generated for postgres using toplink jpa
Date: 2008-02-02 06:29:05
Message-ID: EC90E801BE917645B6DB6239B85E78940391A5E1@TRVMSG.ustr.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi
Solution is available at
http://forums.oracle.com/forums/thread.jspa?messageID=2325330&#2325330

-----Original Message-----
From: Arun ViswanathanChandrika
Sent: Friday, February 01, 2008 8:22 PM
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #3920: sequence not generated for postgres using toplink
jpa

The following bug has been logged online:

Bug reference: 3920
Logged by: Arun
Email address: arun(dot)viswanathanchandrika(at)ust-global(dot)com
PostgreSQL version: 8.2
Operating system: Win XP
Description: sequence not generated for postgres using toplink
jpa
Details:

sequence not generated for postgres using toplink jpa

This sequence generator code is not working properly

@SequenceGenerator(name="catalog_seq_gen", sequenceName="catalog_seq",
allocationSize=1)
@Id @GeneratedValue(strategy = GenerationType.SEQUENCE,generator =
"catalog_seq_gen")
@Column(name ="catalog_id", nullable = false)
private Long catalogId;

@Column(name = "CATALOG_NAME", nullable = false)
private String catalogName;
@Column(name = "CATALOG_DESC")
private String catalogDesc;

I have 3 fields in the code and toplink is generating the query wrongly

Exception in thread "main" javax.persistence.PersistenceException:
javax.persistence.PersistenceException: Exception [TOPLINK-4002] (Oracle
TopLink Essentials - 2.0 (Build SNAPSHOT (06/04/2007))):
oracle.toplink.essentials.exceptions.DatabaseException
Internal Exception: org.postgresql.util.PSQLException: ERROR: null value
in
column "catalog_id" violates not-null constraint
Error Code: 0
Call: INSERT INTO CATALOG (CATALOG_NAME, CATALOG_DESC) VALUES (?, ?)
bind => [Description, null]

ideally it should generate

INSERT INTO CATALOG (CATALOG_ID, CATALOG_NAME, CATALOG_DESC) VALUES
(?,?,
?)
bind => [1, Description, null]

I am using Oracle TopLink 11g: Technical Preview 3

what could be the reason?

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Peter Eisentraut 2008-02-02 12:58:03 Re: BUG #3922: Problems migrating databases.
Previous Message Maximiliano 2008-02-01 22:39:39 BUG #3922: Problems migrating databases.