-->
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.  [ 1 post ] 
Author Message
 Post subject: session.save creates new object on update
PostPosted: Fri Jun 17, 2005 11:09 am 
Newbie

Joined: Fri Aug 27, 2004 10:33 am
Posts: 2
I have a persisted object, that has been working fine, until now when I update the object, a new one is created because EntityEntry comes back as null in session.save. (Which I call using Spring's HibernateTemplate)

I stepped through the code, and the object is correctly in memory (with id) until that point and then saveWithGeneratedIdentifier ends up being called.

I guess it is something to do with flush mode/transactions. I'd appreciate if anyone can give me some pointers as to where to start looking for the problem.


Thx,
Evan

Hibernate version:
2.1

Name and version of the database you are using:
MySQL 4.1

Eclipse debugger output for the state of SessionImpl when this happens...
Code:
this= SessionImpl  (id=621)
   arrayHolders= IdentityMap  (id=636)
   autoClose= true
   batcher= BatchingBatcher  (id=638)
   batchLoadableEntityKeys= SequencedHashMap  (id=642)
   cascading= 0
   closed= false
   collectionCreations= ArrayList<E>  (id=645)
   collectionEntries= IdentityMap  (id=646)
   collectionRemovals= ArrayList<E>  (id=647)
   collectionsByKey= HashMap<K,V>  (id=648)
   collectionUpdates= ArrayList<E>  (id=649)
   connect= false
   connection= PoolingDataSource$PoolGuardConnectionWrapper  (id=650)
   deletions= ArrayList<E>  (id=655)
   dontFlushFromFind= 0
   entitiesByKey= HashMap<K,V>  (id=656)
   entityEntries= IdentityMap  (id=657)
   executions= ArrayList<E>  (id=658)
   factory= SessionFactoryImpl  (id=572)
   flushing= false
   flushMode= FlushMode  (id=659)
      level= 10
      name= "AUTO"
   insertions= ArrayList<E>  (id=661)
   interceptor= Configuration$EmptyInterceptor  (id=603)
   isCurrentTransaction= true
   lastClass= Class<T> (ts.platform.core.ContentResource) (id=272)
   lastResultForClass= EntityPersister  (id=691)
   loadCounter= 0
   loadingCollections= HashMap<K,V>  (id=662)
   nonExists= HashSet<E>  (id=663)
   nonlazyCollections= ArrayList<E>  (id=667)
   nullifiables= HashSet<E>  (id=668)
   proxiesByKey= HashMap<K,V>  (id=669)
   timestamp= 4583501580660736
   updates= ArrayList<E>  (id=670)


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

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.