Hi
I'm using EclipseLink with H2 database and my configuration looks like the following:
<persistence-unit name="persistence-h2" transaction-type="RESOURCE_LOCAL">
<!-- provider>org.eclipse.persistence.jpa.PersistenceProvider</provider -->
<class>my.datalayer.entity.User</class>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="javax.persistence.jdbc.driver" value="org.h2.Driver" />
<property name="javax.persistence.jdbc.url" value="jdbc:h2:mem:test-db" />
<property name="javax.persistence.jdbc.user" value="sa" />
<property name="eclipselink.target-database" value="org.eclipse.persistence.platform.database.H2Platform"/>
<property name="eclipselink.ddl-generation" value="drop-create-tables" />
<property name="eclipselink.ddl-generation.output-mode" value="both" />
<property name="eclipselink.logging.level" value="info"/>
</properties>
</persistence-unit>
</persistence>
Once I run unit test I get the following exception, however the test passes:
Internal Exception: org.h2.jdbc.JdbcSQLException: Sequence "REQUEST_RECIPIENTS_SEQ" not found; SQL statement:
CALL NEXT VALUE FOR REQUEST_RECIPIENTS_SEQ [90036-174]
Error Code: 90036
Call: CALL NEXT VALUE FOR REQUEST_RECIPIENTS_SEQ
Query: ValueReadQuery(sql="CALL NEXT VALUE FOR REQUEST_RECIPIENTS_SEQ")
[EL Warning]: 2014-01-03 13:34:08.695--ServerSession(1195622205)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.1.v20130918-f2b9fc5): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: org.h2.jdbc.JdbcSQLException: Sequence "REQUESTS_SEQUENCE" not found; SQL statement:
CALL NEXT VALUE FOR REQUESTS_SEQUENCE [90036-174]
Error Code: 90036
Call: CALL NEXT VALUE FOR REQUESTS_SEQUENCE
I'm using the following strategy for Id's:
@Id
@GeneratedValue(strategy = SEQUENCE, generator = "REQUESTS_SEQUENCE")
@Column(name = "ID")
private Long id;
It seems that sequence is not properly created or something?
Regards,
Andriy L.