NHibernate version: 1.0.2.0
Hello All,
I'm using the syscache from the contrib along with Nhibernate, and I find that very rarely, the NHibernate.AssertionFailure below fires. It is very difficult to reproduce, and thus has been challenging to debug.
The exception is stating that there is already an entry in syscache's _map for this object, when we're trying to .Add() it (so the _map, which is Hashtable, throws).
The code on top of the stack trace below is just .Save()'ing objects with Guids as keys. The guids are obtained from Guid.NewGuid() so it cannot be the case that 2 different objects have the same key.
This seems similar to a post fom July in the forum, which sadly has no replies:
http://forum.hibernate.org/viewtopic.php?t=962045
Any ideas are most appreciated. Many thanks.
Full stack trace of exception that occurs:
************** Exception Text **************
NHibernate.TransactionException: Commit failed with SQL exception ---> NHibernate.AssertionFailure: Exception releasing cache locks ---> System.ArgumentException: Item has already been added. Key in dictionary: 'NHibernate-Cache:Msg.Framework.RUdpTransport.RMOutMsg:c24d7914-0898-47d7-a4a8-40c652c9db39@-1965736198' Key being added: 'NHibernate-Cache:Msg.Framework.RUdpTransport.RMOutMsg:c24d7914-0898-47d7-a4a8-40c652c9db39@-1965736198'
at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)
at System.Collections.Hashtable.Add(Object key, Object value)
at NHibernate.Caches.SysCache.SysCache.Put(Object key, Object value)
at NHibernate.Cache.ReadWriteCache.AfterInsert(Object key, Object value, Object version)
at NHibernate.Impl.ScheduledInsertion.AfterTransactionCompletion(Boolean success)
at NHibernate.Impl.SessionImpl.AfterTransactionCompletion(Boolean success)
--- End of inner exception stack trace ---
at NHibernate.Impl.SessionImpl.AfterTransactionCompletion(Boolean success)
at NHibernate.Transaction.AdoTransaction.Commit()
--- End of inner exception stack trace ---