users@glassfish.java.net

Re: seq_gen_sequence error with toplink 2.1b23

From: <glassfish_at_javadesktop.org>
Date: Fri, 07 Mar 2008 06:58:41 PST

Hi.

Thanks for the quick reply.

I declare my id fields like this:

        @Id
        @GeneratedValue(strategy=GenerationType.SEQUENCE)
        private Long id;

With "earlier" I meant, that with the old toplink version it created with the above configuration native postgresql sequence like:

CREATE SEQUENCE users_id_seq
  INCREMENT 1
  MINVALUE 1
  MAXVALUE 9223372036854775807
  START 4
  CACHE 1;
ALTER TABLE users_id_seq OWNER TO foo;

After switching to 2.1b23 it only creates the "seq_gen_sequence" sequence and complains about the non existing "seq_gen_sequence" (I know it sounds odd) - without creating my other sequences (one per table) like before 2.1b23. I never came in contact with the IDENTITY thingie at all.

I like that native sequences are used for entity id's and I would like to keep that behavior. So if I understand you correctly, I should use IDENTITY to get sequences under postgresql? Sounds odd to me :).
[Message sent by forum member 'vguna' (vguna)]

http://forums.java.net/jive/thread.jspa?messageID=262901