Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Problem with sequence setup "increment does not match its pre-allocation size.; nested exception is javax.persistence.EntityExistsException: Exception Description: The sequence named [REL_PERSTITL_S1] is setup incorrectly. Its increment does not match its pre-allocation size.

Hi All,

I'm using Eclipselink version 1.1.2 and I have the following problem:

If I have a simply entity with the following item representing the primary
key
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator =
"SEQUENCE_S1")
@SequenceGenerator(name = "SEQUENCE_S1", sequenceName = "SEQUENCE_S1",
allocationSize = 100)
@Column(name = "ID", nullable = false)
private Long id;

And the SEQUENCE_S1 is a freshly created uninitialized sequence with
increment by value of 100.

Then my unit test case, that is persisting an entity, will fail with the
following exception:
org.springframework.dao.DataIntegrityViolationException: 
Exception Description: The sequence named [SEQUENCE_S1] is setup
incorrectly.  Its increment does not match its pre-allocation size.; nested
exception is javax.persistence.EntityExistsException: 

The really weird thing is. If I have the allocationsize set to 1 or if I by
hand initialize the sequence before I run the unit test, the unit test will
NOT fail. Or even when I change nothing and just run the test a second time,
it will not fail.

I'm inclined to think that there may be some issues when persisting an
entity to the (Oracle XE 10g) database with an uninitialized sequence and
allocationSize is not 1.

Can someone help me in finding the cause and solution of this problem?

Thanks in advance,
Ruud Bijkerk,
Oracle


-- 
View this message in context: http://www.nabble.com/Problem-with-sequence-setup-%22increment-does-not-match-its-pre-allocation-size.--nested-exception-is-javax.persistence.EntityExistsException%3A--Exception-Description%3A-The-sequence-named--REL_PERSTITL_S1--is-setup-incorrectly.--Its-increment-does-not-match-its-pre-allocation-size.-tp25490599p25490599.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top