Home » Eclipse Projects » EclipseLink » SequenceGenerator Error(does not go beyond the AllocationSize)
SequenceGenerator Error [message #831881] |
Thu, 29 March 2012 13:31 |
pattabi Messages: 5 Registered: August 2011 |
Junior Member |
|
|
Hi,
I am trying to insert a large number of records from within a for loop. The insert fails with Integrity violation exception once the record number reaches the Allocation size of the SequenceGenerator. I was able to reproduce by changing the allocationSize.
Please find the relevant pieces of information. Could somebody help?
@SequenceGenerator(name="CACHE_KEY_GENERATOR", sequenceName="CACHE_KEY_SEQ", initialValue=1, allocationSize=100)
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="CACHE_KEY_GENERATOR" )
and the sequence SQL is
CREATE SEQUENCE CACHE_KEY_SEQ START WITH 100 MAXVALUE 999999999999999999999999999 MINVALUE 100 NOCYCLE CACHE 20 ;
The exception trace is
Error Code: 1
Call: INSERT INTO CACHE (KEY, ADDRESS_1, ADDRESS_2, ADDRESS_3, CITY, COUNTRY, FIRST_NAME, LAST_NAME, POSTAL_CODE, STATE) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
bind => [2, 5500 HWY U , null, null, TROY, US, null, null, 63379, MO]
Query: InsertObjectQuery(com.pcg.ds.vendorservice.domain.Cache@13a26de)
.....
Query: InsertObjectQuery(com.pcg.ds.vendorservice.domain.Cache@13a26de)
at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:324)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(DatabaseAccessor.java:840)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeNoSelect(DatabaseAccessor.java:906)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:592)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:535)
|
|
| | | |
Goto Forum:
Current Time: Fri Apr 26 17:12:24 GMT 2024
Powered by FUDForum. Page generated in 0.03858 seconds
|