Hibernate version:3.0.5
So, in production, I'm using Oracle, and that works just fine, but for testing purposes I'm trying to use HSQL in memory, and it seems that when I run my test to saveOrUpdate(obj) it's trying to get the next sequence by calling "select next value for SEQ from dual.SEQ"
Any thoughts on why this is?
Anyway, here's the top of my stack trace:
Code:
[junit] org.hibernate.exception.GenericJDBCException: could not get next sequence value
[junit] at org.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:92)
[junit] at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:80)
[junit] at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
[junit] at org.hibernate.id.SequenceGenerator.generate(SequenceGenerator.java:96)
[junit] at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:85)
and the actual SQL Exception:
Code:
[junit] Caused by: java.sql.SQLException: Sequence not found: USER_SEQ in statement [select next value for user.USER_SEQ from dual_user.USER_SEQ]
[junit] at org.hsqldb.jdbc.Util.throwError(Unknown Source)
[junit] at org.hsqldb.jdbc.jdbcPreparedStatement.<init>(Unknown Source)
[junit] at org.hsqldb.jdbc.jdbcConnection.prepareStatement(Unknown Source)
[junit] at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:396)
[junit] at org.hibernate.jdbc.AbstractBatcher.prepareSelectStatement(AbstractBatcher.java:82)
[junit] at org.hibernate.id.SequenceGenerator.generate(SequenceGenerator.java:73)
[junit] ... 24 more
relevant part of hibernate properties:
Code:
hibernate.dialect=org.hibernate.dialect.HSQLDialect
hibernate.jdbc.use_get_generated_keys=true
relevant part of HBM file:
Code:
<id
name="userId"
type="java.lang.Long"
column="USER_ID"
>
<generator class="sequence"><param name="sequence">USER_SEQ</param></generator>
</id>
[/code]