-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: hibernate_sequence at PostgreSQL
PostPosted: Sun Oct 09, 2005 3:11 am 
Newbie

Joined: Tue Aug 23, 2005 10:25 pm
Posts: 4
Location: São Paulo, Brazil
Hello,

I've been changing the Hibernate 3.0 to 3.1rc1 + annotations 3.1beta5, and I got rid of those XML files. Now I'm trying annotations, but suddenly I got the following error when saving:

ERROR 04:02:52 org.hibernate.util.JDBCExceptionReporter.logExceptions(L72) - ERROR: relation "hibernate_sequence" does not exist

The Object I'm trying to save is simple:

...

@Id(generate = GeneratorType.AUTO)
public Long getId() {
return this.id;
}

...

Is this a bug or something I did wrong?

Thanks.

_________________
Tiago Fernandez
http://www.tiago182.spyw.com


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 09, 2005 3:15 am 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
Code:
import org.hibernate.annotations.GenericGenerator;


Code:
@GenericGenerator(name="generator", strategy="increment", parameters = { } )


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 10, 2005 8:39 am 
Newbie

Joined: Tue Aug 23, 2005 10:25 pm
Posts: 4
Location: São Paulo, Brazil
Hi Dennis,

Thanks for replying. Well, I'm not getting this error anymore, now what botters me is the following:

Code:
org.springframework.jdbc.BadSqlGrammarException: Hibernate operation: Could not execute JDBC batch update; bad SQL grammar [insert into operation (nextParcel_id, total_value, cardOperator_id, entrance_date, issuance_date, partial_value, issuance_delay, store_id, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?)]; nested exception is java.sql.BatchUpdateException: Batch entrance 0 insert into operation (nextParcel_id, total_value, cardOperator_id, entrance_date, issuance_date, partial_value, issuance_delay, store_id, id) values (NULL, 99.99, 1, 1128947632531, 1131539632531, 95.990395, 1/1, 1, 1) was aborted. Call getNextException to see the cause.
java.sql.BatchUpdateException: Batch entrance 0 insert into operation (nextParcel_id, total_value, cardOperator_id, entrance_date, issuance_date, partial_value, issuance_delay, store_id, id) values (NULL, 99.99, 1, 1128947632531, 1131539632531, 95.990395, 1/1, 1, 1) was aborted. Call getNextException to see the cause.
   at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(AbstractJdbc2Statement.java:2387)
   at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1257)
   at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:334)
   at org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:2446)
   at com.mchange.v2.sql.filter.FilterPreparedStatement.executeBatch(FilterPreparedStatement.java:260)
   at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:58)
   at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:193)
   at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:230)
   at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:140)
   at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:296)
   at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
   at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:877)
   at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:345)
   at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
   at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:490)
   at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:495)
   at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:468)
   at org.springframework.transaction.interceptor.TransactionAspectSupport.doCommitTransactionAfterReturning(TransactionAspectSupport.java:258)
   at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174)
   at $Proxy14.saveOperation(Unknown Source)
   at tlf.cfex.CfexSessionManagerTestCase.testSaveFindAndDeleteOperations(CfexSessionManagerTestCase.java:87)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at junit.framework.TestCase.runTest(TestCase.java:154)
   at junit.framework.TestCase.runBare(TestCase.java:127)
   at junit.framework.TestResult$1.protect(TestResult.java:106)
   at junit.framework.TestResult.runProtected(TestResult.java:124)
   at junit.framework.TestResult.run(TestResult.java:109)
   at junit.framework.TestCase.run(TestCase.java:118)
   at junit.framework.TestSuite.runTest(TestSuite.java:208)
   at junit.framework.TestSuite.run(TestSuite.java:203)
   at junit.framework.TestSuite.runTest(TestSuite.java:208)
   at junit.framework.TestSuite.run(TestSuite.java:203)
   at junit.framework.TestSuite.runTest(TestSuite.java:208)
   at junit.framework.TestSuite.run(TestSuite.java:203)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)


@GenericGenerator(name="generator", strategy="increment", parameters = { } )
@Id(generator = "generator")
public Long getId() {
return this.id;
}

If you have a tip... but I'll take a closer look later.

Thanks![/code]

_________________
Tiago Fernandez
http://www.tiago182.spyw.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.