-->
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.  [ 2 posts ] 
Author Message
 Post subject: could not read a hi value error
PostPosted: Fri Jun 08, 2007 3:33 am 
Newbie

Joined: Fri Jun 08, 2007 3:16 am
Posts: 11
I use oracle9i to store information,my
Code:
<class name="events.Event" table="EVENTS">
<id name="id" column="EVENT_ID">
<generator class="hilo">
<param name="table">test</param>
<param name="column">next_value</param>
<param name="max_lo">100</param>
</generator>
</id>
<property name="date" type="timestamp" column="EVENT_DATE"/>
<property name="title"/>
</class>


My table is follows:
SQL> desc test
Name Type
------------------------------------
NEXT_VALUE NUMBER(38)


SQL> desc events;
Name Type
-------------------------------------
EVENT_ID NUMBER(19)
EVENT_DATE TIMESTAMP(6)
TITLE VARCHAR2(255 CHAR)

When I run my code,it raise following error:
Exception in thread "main" org.hibernate.id.IdentifierGenerationException: could not read a hi value - you need to populate the table: test
at org.hibernate.id.TableGenerator.doWorkInCurrentTransaction(TableGenerator.java:138)
at org.hibernate.engine.TransactionHelper$1Work.doWork(TransactionHelper.java:38)
at org.hibernate.engine.transaction.Isolater$JdbcDelegate.delegateWork(Isolater.java:187)
at org.hibernate.engine.transaction.Isolater.doIsolatedWork(Isolater.java:43)
at org.hibernate.engine.TransactionHelper.doWorkInNewTransaction(TransactionHelper.java:51)
at org.hibernate.id.TableGenerator.generate(TableGenerator.java:94)
at org.hibernate.id.TableHiLoGenerator.generate(TableHiLoGenerator.java:62)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId
(AbstractSaveEventListener.java:99)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGene
ratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:187)
at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrR
equestedId(DefaultSaveEventListener.java:33)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTran
sient(DefaultSaveOrUpdateEventListener.java:172)
at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(
DefaultSaveEventListener.java:27)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:535)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:519)
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:324)
at org.hibernate.context.ThreadLocalSessionContext$TransactionProtection
Wrapper.invoke(ThreadLocalSessionContext.java:301)
at $Proxy0.save(Unknown Source)
at events.EventManager.createAndStoreEvent(EventManager.java:40)
at events.EventManager.main(EventManager.java:10)

I guess I may create table wrong test,maybe miss some columns,but I don't know how to do it.Anybody could tell me how to do it?
Thanks
Edward


Top
 Profile  
 
 Post subject: Re: could not read a hi value error
PostPosted: Thu May 13, 2010 5:33 am 
Newbie

Joined: Thu May 13, 2010 5:21 am
Posts: 1
hi Friend,
when i was doing a hilo program i had got same error. for that purpose u need not to create new table if ur table is correct. i have seen ur error,
ur table creation is correct but u forgot to run commit command.
after table creation run commit cmd then ur error will solve.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.