-->
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: Updating version in Hibernate
PostPosted: Tue Jun 12, 2007 3:53 am 
Newbie

Joined: Mon Jun 11, 2007 2:48 am
Posts: 10
Hi i'm having a problem in hibernate when i try to update the version number during an "update". Ideally hibernate should increment it auotmatically but its not doing so. i'm getting this error.

[6/11/07 12:11:14:168 IST] 1bcaf293 SystemErr R java.lang.NullPointerException
[6/11/07 12:11:14:168 IST] 1bcaf293 SystemErr R at org.hibernate.type.IntegerType.next(IntegerType.java:57)
[6/11/07 12:11:14:168 IST] 1bcaf293 SystemErr R at org.hibernate.engine.Versioning.increment(Versioning.java:25)
[6/11/07 12:11:14:168 IST] 1bcaf293 SystemErr R at org.hibernate.event.def.DefaultFlushEntityEventListener.getNextVersion(DefaultFlushEntityEventListener.java:262)
[6/11/07 12:11:14:168 IST] 1bcaf293 SystemErr R at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:140)
[6/11/07 12:11:14:168 IST] 1bcaf293 SystemErr R at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:190)
[6/11/07 12:11:14:168 IST] 1bcaf293 SystemErr R at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:70)
[6/11/07 12:11:14:168 IST] 1bcaf293 SystemErr R at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
[6/11/07 12:11:14:168 IST] 1bcaf293 SystemErr R at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:730)


Can someone help me with this?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 12, 2007 8:00 am 
Regular
Regular

Joined: Mon Mar 26, 2007 12:38 am
Posts: 119
Hi,
>> Ideally hibernate should increment it auotmatically but its not doing so.
Check if, <version generated="never" />

>> Error ( Null Pointer Exception )
You get this error if version field is set to null when the update is fired.
Check the value before update.

If these don't work, post the mappings and query.

-------------------------------------------------
Rate the reply if you find it helpful


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 12, 2007 8:13 am 
Newbie

Joined: Mon Jun 11, 2007 2:48 am
Posts: 10
Hey thanks pramod..its working now! :)


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.