users@glassfish.java.net

Re: GF 2.1b60e breaks backward compatibiliy SEQ_GEN_SEQUENCE bug

From: <glassfish_at_javadesktop.org>
Date: Wed, 11 Feb 2009 11:49:42 PST

The older version of TopLink Essentials didn't support Identity and SequenceObjects on the same database platform - it should have been either one or another.
That's why strategies SEQUENCE and IDENTITY used to be treated as if they are the same.
PostgreSQL used to support Identity, therefore SEQUENCE used to be processed as Identity - the sequence object name was derived from the table and pk names.

In the new release both SEQUENCE and IDENTITY supported on PostgreSQL platform. Now only IDENTITY causes the setup which both SEQUENCE and IDENTITY used to cause before - that's why you need to use IDENTITY instead of SEQUENCE.

Alternatively, if you wish to use sequence object you have to somehow specify its name. Normally it's done by specifying SequenceGenerator:
@SequenceGenerator(name="ADDRESS_SEQ_GEN", sequenceName="ADDRESS_SEQ", allocationSize=25)
@GeneratedValue(generator="ADDRESS_SEQ_GEN", strategy=GenerationType.SEQUENCE)

However in case no generator provided:
@GeneratedValue(strategy=GenerationType.SEQUENCE)
TopLink Essentials would use default sequence generator named SEQ_GEN_SEQUENCE, which (unless overridden by the user) defines sequence object with the same name.
[Message sent by forum member 'ailitche' (ailitche)]

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