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)