It locks to me like Nhibernate updates instead of inserting!
VersionObject code:
private IList com1s;
public IList Com1s
{
get
{
if (com1s == null)
{
com1s = new ArrayList();
}
return com1s;
}
set { com1s = value; }
}
public void AddCom1s(VersionComElm1 elm1)
{
Com1s.Add(elm1);
elm1.Parent = this;
}
log4net log:
49970 [2484] ERROR NHibernate.Persister.GetSetHelperFactory (null) - Line:12, Column:3 Message:The type 'Terma.TMission.TSystem.TVersion.VersionAdapter' is defined in an assembly that is not referenced. You must add a reference to assembly'IVersion, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
49970 [2484] ERROR NHibernate.Persister.GetSetHelperFactory (null) - Line:12, Column:3 Message:The type 'Terma.TMission.TSystem.TVersion.IVersionParent' is defined in an assembly that is not referenced. You must add a reference to assembly'IVersion, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
49970 [2484] INFO NHibernate.Persister.GetSetHelperFactory (null) - Disabling reflection optimizer for class PersistenUnitTest.VersionObject
49970 [2484] DEBUG NHibernate.Persister.GetSetHelperFactory (null) - CodeDOM compilation failedSystem.InvalidOperationException: The type 'Terma.TMission.TSystem.TVersion.VersionAdapter' is defined in an assembly that is not referenced. You must add a reference to assembly 'IVersion, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. at NHibernate.Persister.GetSetHelperFactory.Build(String code) at NHibernate.Persister.GetSetHelperFactory.Create(Type mappedClass, ISetter[] setters, IGetter[] getters)
49970 [2484] DEBUG NHibernate.Impl.SessionFactoryObjectFactory (null) - registered: e91d7e8fce7e43f6a0d1e6ab3b9d6299(unnamed)
49970 [2484] INFO NHibernate.Impl.SessionFactoryObjectFactory (null) - no name configured
49970 [2484] DEBUG NHibernate.Impl.SessionFactoryImpl (null) - Instantiated session factory
49980 [2484] DEBUG NHibernate.Impl.SessionImpl (null) - opened session
49980 [2484] DEBUG NHibernate.Transaction.AdoTransaction (null) - begin
49980 [2484] DEBUG NHibernate.Connection.DriverConnectionProvider (null) - Obtaining IDbConnection from Driver
49990 [2484] DEBUG NHibernate.Impl.SessionImpl (null) - generated identifier: 303ed004-aade-4634-8278-dcf4eb977ece
49990 [2484] DEBUG NHibernate.Impl.SessionImpl (null) - saving [PersistenUnitTest.VersionObject#303ed004-aade-4634-8278-dcf4eb977ece]
50000 [2484] DEBUG NHibernate.Engine.Cascades (null) - processing cascades for:PersistenUnitTest.VersionObject
50010 [2484] DEBUG NHibernate.Engine.Cascades (null) - done processing cascadesfor: PersistenUnitTest.VersionObject
50020 [2484] DEBUG NHibernate.Impl.WrapVisitor (null) - Wrapped collection in role: PersistenUnitTest.VersionObject.Com1s
50020 [2484] DEBUG NHibernate.Engine.Cascades (null) - processing cascades for:PersistenUnitTest.VersionObject
50020 [2484] DEBUG NHibernate.Engine.Cascades (null) - cascading to collection:PersistenUnitTest.VersionObject.Com1s
50030 [2484] DEBUG NHibernate.Engine.Cascades (null) - cascading to SaveOrUpdate()
50030 [2484] DEBUG NHibernate.Engine.Cascades (null) - unsaved-value: 00000000-0000-0000-0000-000000000000
50030 [2484] DEBUG NHibernate.Impl.SessionImpl (null) - SaveOrUpdate() previously saved instance with id: 75c0da9a-115a-477e-a186-2bfce4618e47
50030 [2484] DEBUG NHibernate.Impl.SessionImpl (null) - updating [PersistenUnitTest.VersionComElm1#75c0da9a-115a-477e-a186-2bfce4618e47]
50030 [2484] DEBUG NHibernate.Engine.Cascades (null) - cascading to SaveOrUpdate()
50030 [2484] DEBUG NHibernate.Engine.Cascades (null) - unsaved-value: 00000000-0000-0000-0000-000000000000
50030 [2484] DEBUG NHibernate.Impl.SessionImpl (null) - SaveOrUpdate() previously saved instance with id: 6aec4cc9-a9c2-4f10-b485-b0068b7d5f56
50030 [2484] DEBUG NHibernate.Impl.SessionImpl (null) - updating [PersistenUnitTest.VersionComElm1#6aec4cc9-a9c2-4f10-b485-b0068b7d5f56]
50030 [2484] DEBUG NHibernate.Engine.Cascades (null) - done processing cascadesfor: PersistenUnitTest.VersionObject
50040 [2484] DEBUG NHibernate.Transaction.AdoTransaction (null) - commit
50040 [2484] DEBUG NHibernate.Impl.SessionImpl (null) - flushing session
50040 [2484] DEBUG NHibernate.Engine.Cascades (null) - processing cascades for:PersistenUnitTest.VersionObject
50040 [2484] DEBUG NHibernate.Engine.Cascades (null) - cascading to collection:PersistenUnitTest.VersionObject.Com1s
50040 [2484] DEBUG NHibernate.Engine.Cascades (null) - cascading to SaveOrUpdate()
50040 [2484] DEBUG NHibernate.Impl.SessionImpl (null) - SaveOrUpdate() persistent instance
50040 [2484] DEBUG NHibernate.Engine.Cascades (null) - cascading to SaveOrUpdate()
50040 [2484] DEBUG NHibernate.Impl.SessionImpl (null) - SaveOrUpdate() persistent instance
50040 [2484] DEBUG NHibernate.Engine.Cascades (null) - done processing cascadesfor: PersistenUnitTest.VersionObject
50040 [2484] DEBUG NHibernate.Impl.SessionImpl (null) - Flushing entities and processing referenced collections
50050 [2484] DEBUG NHibernate.Impl.AbstractVisitor (null) - Processing collection for role PersistenUnitTest.VersionObject.Com1s
50050 [2484] DEBUG NHibernate.Impl.SessionImpl (null) - Collection found: [PersistenUnitTest.VersionObject.Com1s#303ed004-aade-4634-8278-dcf4eb977ece], was: [<unreferenced>]
50050 [2484] DEBUG NHibernate.Impl.SessionImpl (null) - Updating entity: [PersistenUnitTest.VersionComElm1#75c0da9a-115a-477e-a186-2bfce4618e47]
50060 [2484] DEBUG NHibernate.Impl.SessionImpl (null) - Updating entity: [PersistenUnitTest.VersionComElm1#6aec4cc9-a9c2-4f10-b485-b0068b7d5f56]
50060 [2484] DEBUG NHibernate.Impl.SessionImpl (null) - Processing unreferencedcollections
50060 [2484] DEBUG NHibernate.Impl.SessionImpl (null) - scheduling collection removes/(re)creates/updates
50060 [2484] DEBUG NHibernate.Impl.SessionImpl (null) - Flushed: 1 insertions, 2 updates, 0 deletions to 3 objects
50060 [2484] DEBUG NHibernate.Impl.SessionImpl (null) - Flushed: 1 (re)creations, 0 updates, 0 removals to 1 collections
50060 [2484] DEBUG NHibernate.Impl.Printer (null) - listing entities:
50060 [2484] DEBUG NHibernate.Impl.Printer (null) - PersistenUnitTest.VersionComElm1{Label=Com1, Id=6aec4cc9-a9c2-4f10-b485-b0068b7d5f56}
50071 [2484] DEBUG NHibernate.Impl.Printer (null) - PersistenUnitTest.VersionObject{VersionId=303ed004-aade-4634-8278-dcf4eb977ece, Com1s=[VersionComElm1#75c0da9a-115a-477e-a186-2bfce4618e47, VersionComElm1#6aec4cc9-a9c2-4f10-b485-b0068b7d5f56]}
50071 [2484] DEBUG NHibernate.Impl.Printer (null) - PersistenUnitTest.VersionComElm1{Label=Com1, Id=75c0da9a-115a-477e-a186-2bfce4618e47}
50071 [2484] DEBUG NHibernate.Impl.SessionImpl (null) - executing flush
50071 [2484] DEBUG NHibernate.Persister.EntityPersister (null) - Inserting entity: [PersistenUnitTest.VersionObject#303ed004-aade-4634-8278-dcf4eb977ece]
50081 [2484] DEBUG NHibernate.Impl.BatcherImpl (null) - Opened new IDbCommand, open IDbCommands :1
50081 [2484] DEBUG NHibernate.Impl.BatcherImpl (null) - Building an IDbCommand object for the SqlString: INSERT INTO versionobject (id) VALUES (:id)
50081 [2484] DEBUG NHibernate.Persister.EntityPersister (null) - Dehydrating entity: [PersistenUnitTest.VersionObject#303ed004-aade-4634-8278-dcf4eb977ece]
50081 [2484] DEBUG NHibernate.Type.GuidType (null) - binding '303ed004-aade-4634-8278-dcf4eb977ece' to parameter: 0
50081 [2484] DEBUG NHibernate.SQL (null) - INSERT INTO versionobject (id) VALUES (@p0)
50151 [2484] DEBUG NHibernate.Impl.BatcherImpl (null) - Closed IDbCommand, openIDbCommands :0
50151 [2484] DEBUG NHibernate.Persister.EntityPersister (null) - Updating entity: [PersistenUnitTest.VersionComElm1#75c0da9a-115a-477e-a186-2bfce4618e47]
50151 [2484] DEBUG NHibernate.Impl.BatcherImpl (null) - Opened new IDbCommand, open IDbCommands :1
50161 [2484] DEBUG NHibernate.Impl.BatcherImpl (null) - Building an IDbCommand object for the SqlString: UPDATE versionComElm1 SET label = :label WHERE id = :id
50161 [2484] DEBUG NHibernate.Persister.EntityPersister (null) - Dehydrating entity: [PersistenUnitTest.VersionComElm1#75c0da9a-115a-477e-a186-2bfce4618e47]
50161 [2484] DEBUG NHibernate.Type.StringType (null) - binding 'Com1' to parameter: 0
50161 [2484] DEBUG NHibernate.Type.GuidType (null) - binding '75c0da9a-115a-477e-a186-2bfce4618e47' to parameter: 1
50161 [2484] DEBUG NHibernate.SQL (null) - UPDATE versionComElm1 SET label = @p0 WHERE id = @p1
50221 [2484] DEBUG NHibernate.Impl.BatcherImpl (null) - Closed IDbCommand, openIDbCommands :0
50231 [2484] ERROR NHibernate.Impl.SessionImpl (null) - could not synchronize database state with sessionNHibernate.HibernateException: SQL insert, update or delete failed (expected affected row count: 1, actual affected row count: 0). Possible causes: the row wasmodified or deleted by another user, or a trigger is reporting misleading row count. at NHibernate.Impl.NonBatchingBatcher.AddToBatch(Int32 expectedRowCount) at NHibernate.Persister.EntityPersister.Update(Object id, Object[] fields, Object[] oldFields, Boolean[] includeProperty, Object oldVersion, Object obj, SqlString sqlUpdateString, ISessionImplementor session) at NHibernate.Persister.EntityPersister.Update(Object id, Object[] fields, Int32[] dirtyFields, Object[] oldFields, Object oldVersion, Object obj, ISessionImplementor session) at NHibernate.Impl.ScheduledUpdate.Execute() at NHibernate.Impl.SessionImpl.Execute(IExecutable executable) at NHibernate.Impl.SessionImpl.ExecuteAll(IList list) at NHibernate.Impl.SessionImpl.Execute()
50241 [2484] DEBUG NHibernate.Transaction.AdoTransaction (null) - rollback
50251 [2484] DEBUG NHibernate.Transaction.AdoTransaction (null) - running AdoTransaction.Dispose()
50251 [2484] DEBUG NHibernate.Impl.SessionImpl (null) - transaction completion
|