Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » H2 with EclipseLink(Sequence not found error)
H2 with EclipseLink [message #1227053] Fri, 03 January 2014 11:50
Andriy L is currently offline Andriy LFriend
Messages: 1
Registered: January 2014
Junior Member
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.
Previous Topic:JPA reuse some "previous" JDBC login credentials
Next Topic:Change user/pwd on EntityManager in J2EE for auditing
Goto Forum:
  


Current Time: Fri Apr 03 17:31:19 GMT 2020

Powered by FUDForum. Page generated in 0.04489 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top