Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Sequence generator problem with Derby,

Hello Again.

I finally figure the problem

For performance reason, derby internally allocate the sequencers with 100 values and failed to retrieve the unused values.

Everything works well after I add:
System.setProperty("derby.language.sequence.preallocator", "1");

to the properties.



2013/7/24 José Arcángel Salazar Delgado <arcangel.salazar@xxxxxxxxxxxxxxxxxx>
Hello.

I Have this entity:

@Entity
@Table(name = "Productos")
public class Producto{
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="productos_seq" )
@SequenceGenerator(name="productos_seq", sequenceName="PRODUCTOS_SEQ", initialValue=1, allocationSize=1)
private Integer id;
...Omit

The database is created with eclipselink DDL-create using Derby DB 10.10.1.1.

If I insert 3 objects I obtain IDs:

1
2
3

but if I restart the app, the next time I insert three objects I obtain:
101
102
103

Instead of the expected:
4
5
6

Is this a bug?
or is working correctly?

Thanks for your time.


Back to the top