when I run my program, NHibernate produce somtimes the following log.
they are two issues with this:
1) one of my entity is not saved in base. As I use composite ID, I only use session.Save and session.Update, never session.saveOrUpdate. And I assume that Save or Update are called in the right way. I spent many days to check that. I read log and try to understand what happend but I was not abl to do it. Actually there is an UPDATE sql request that fails, this is the reason why of the NHibernate.StaleStateException( Unexpected row count: 0; expected: 1). But what I don't understand is why the previous insert failed whithout NHibernate throw any error. And Why when I execute this request in SQLTools it work's just fine.
2) the second issue is the log the end:An AssertionFailure occured - this may indicate a bug in NHibernate [NHibernate.AssertionFailure (Worker Database synchronizer thread)]
NHibernate.AssertionFailure: no collection snapshot for orphan delete
It is a little bit scarying, and I don't know why it happends
thank you for you help, if you need some others details feel free to ask.
Hibernate version:
1.2.0.GA
Mapping documents:
<?xml version="1.0" encoding="utf-8"?>
<!--Generated from NHibernate.Mapping.Attributes on 2007-12-14 10:23:06Z.-->
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="Ecn.ElectronicEye.NHibernateMappingClass.ServerInfo, ElectronicEye.NHibernateMappingClass" table="TSRVADREMS">
<id name="Name" column="NAME">
<generator class="assigned" />
</id>
<property name="Service" length="8" not-null="true" />
<property name="Address" length="30" not-null="true" />
<property name="Port" />
</class>
<class name="Ecn.ElectronicEye.NHibernateMappingClass.DatabaseStrategy, ElectronicEye.NHibernateMappingClass" table="TSTREYEEMS">
<composite-id name="UniqueId">
<key-property name="User" column="USER_ID" />
<key-property name="Id" column="id" />
</composite-id>
<property name="Parameters" length="512" />
<property name="Inventory" length="50" />
<property name="Activated" />
<property name="Name" length="50" />
<property name="Type" column="STRAT_TYPE" />
<map name="Orders" table="TORDEYEEMS" lazy="false" fetch="join" cascade="all-delete-orphan" inverse="true" optimistic-lock="false">
<key>
<column name="USER_ID" />
<column name="STRATEGY_ID" />
</key>
<index column="ORDER_ID" type="int" />
<one-to-many class="Ecn.ElectronicEye.NHibernateMappingClass.DatabaseOrder, ElectronicEye.NHibernateMappingClass" />
</map>
</class>
<class name="Ecn.ElectronicEye.NHibernateMappingClass.DatabaseOrder, ElectronicEye.NHibernateMappingClass" table="TORDEYEEMS">
<composite-id name="UniqueId">
<key-property name="User" column="USER_ID" />
<key-property name="OrderId" column="ORDER_ID" />
<key-property name="StrategyId" column="STRATEGY_ID" />
</composite-id>
<property name="EboxReference" column="EBOX_REF" />
<property name="Price" />
<property name="Quantity" column="Qty" />
<property name="LastError" column="LAST_ERROR" />
<property name="ExecutedQuantity" column="EXE_QTY" />
<property name="ExecutionAveragePrice" column="EXE_AVG_PRICE" />
<property name="CreationDate" column="CREATE_DATE" />
<property name="Way" />
</class>
<class name="Ecn.ElectronicEye.NHibernateMappingClass.DatabaseEmsParameter, ElectronicEye.NHibernateMappingClass" table="TPAREMS">
<composite-id name="Id">
<key-property name="Application" column="Application" />
<key-property name="User" column="Login" />
<key-property name="Param" column="Param" />
</composite-id>
<property name="Location" />
<property name="Value" />
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Full log including stack trace for exception
10:24:21,849 [DEBUG] Processing database synchronisation [Ecn.ElectronicEye.Server.PersistenceManager (Worker Database synchronizer thread)]
10:24:21,849 [DEBUG] opened session [NHibernate.Impl.SessionImpl (Worker Database synchronizer thread)]
10:24:21,849 [DEBUG] begin [NHibernate.Transaction.AdoTransaction (Worker Database synchronizer thread)]
10:24:21,849 [DEBUG] Obtaining IDbConnection from Driver [NHibernate.Connection.DriverConnectionProvider (Worker Database synchronizer thread)]
10:24:21,849 [DEBUG] Saving:User[t_Eeye] Strategy [1] in database [Ecn.ElectronicEye.Server.PersistenceManager (Worker Database synchronizer thread)]
10:24:21,849 [DEBUG] generated identifier: Ecn.ElectronicEye.NHibernateMappingClass.StrategyCompositeId [NHibernate.Impl.SessionImpl (Worker Database synchronizer thread)]
10:24:21,849 [DEBUG] saving [Ecn.ElectronicEye.NHibernateMappingClass.DatabaseStrategy#Ecn.ElectronicEye.NHibernateMappingClass.StrategyCompositeId] [NHibernate.Impl.SessionImpl (Worker Database synchronizer thread)]
10:24:21,865 [DEBUG] processing cascades for: Ecn.ElectronicEye.NHibernateMappingClass.DatabaseStrategy [NHibernate.Engine.Cascades (Worker Database synchronizer thread)]
10:24:21,865 [DEBUG] done processing cascades for: Ecn.ElectronicEye.NHibernateMappingClass.DatabaseStrategy [NHibernate.Engine.Cascades (Worker Database synchronizer thread)]
10:24:21,880 [DEBUG] Wrapped collection in role: Ecn.ElectronicEye.NHibernateMappingClass.DatabaseStrategy.Orders [NHibernate.Impl.WrapVisitor (Worker Database synchronizer thread)]
10:24:21,896 [DEBUG] processing cascades for: Ecn.ElectronicEye.NHibernateMappingClass.DatabaseStrategy [NHibernate.Engine.Cascades (Worker Database synchronizer thread)]
10:24:21,896 [DEBUG] cascading to collection: Ecn.ElectronicEye.NHibernateMappingClass.DatabaseStrategy.Orders [NHibernate.Engine.Cascades (Worker Database synchronizer thread)]
10:24:21,896 [DEBUG] cascading to SaveOrUpdate() [NHibernate.Engine.Cascades (Worker Database synchronizer thread)]
10:24:21,896 [DEBUG] unsaved-value strategy NONE [NHibernate.Engine.Cascades (Worker Database synchronizer thread)]
10:24:21,896 [DEBUG] SaveOrUpdate() previously saved instance with id: Ecn.ElectronicEye.NHibernateMappingClass.OrderCompositeId [NHibernate.Impl.SessionImpl (Worker Database synchronizer thread)]
10:24:21,896 [DEBUG] updating [Ecn.ElectronicEye.NHibernateMappingClass.DatabaseOrder#Ecn.ElectronicEye.NHibernateMappingClass.OrderCompositeId] [NHibernate.Impl.SessionImpl (Worker Database synchronizer thread)]
10:24:21,912 [DEBUG] cascading to SaveOrUpdate() [NHibernate.Engine.Cascades (Worker Database synchronizer thread)]
10:24:21,912 [DEBUG] unsaved-value strategy NONE [NHibernate.Engine.Cascades (Worker Database synchronizer thread)]
10:24:21,912 [DEBUG] SaveOrUpdate() previously saved instance with id: Ecn.ElectronicEye.NHibernateMappingClass.OrderCompositeId [NHibernate.Impl.SessionImpl (Worker Database synchronizer thread)]
10:24:21,912 [DEBUG] updating [Ecn.ElectronicEye.NHibernateMappingClass.DatabaseOrder#Ecn.ElectronicEye.NHibernateMappingClass.OrderCompositeId] [NHibernate.Impl.SessionImpl (Worker Database synchronizer thread)]
10:24:21,912 [DEBUG] done processing cascades for: Ecn.ElectronicEye.NHibernateMappingClass.DatabaseStrategy [NHibernate.Engine.Cascades (Worker Database synchronizer thread)]
10:24:21,912 [DEBUG] Updating:User[t_Eeye] Strategy [1] in database [Ecn.ElectronicEye.Server.PersistenceManager (Worker Database synchronizer thread)]
10:24:21,912 [DEBUG] object already associated with session [NHibernate.Impl.SessionImpl (Worker Database synchronizer thread)]
10:24:21,912 [DEBUG] Updating:User[t_Eeye] Strategy [1] in database [Ecn.ElectronicEye.Server.PersistenceManager (Worker Database synchronizer thread)]
10:24:21,912 [DEBUG] object already associated with session [NHibernate.Impl.SessionImpl (Worker Database synchronizer thread)]
10:24:21,912 [DEBUG] Updating:User[t_Eeye] Strategy [1] in database [Ecn.ElectronicEye.Server.PersistenceManager (Worker Database synchronizer thread)]
10:24:21,912 [DEBUG] object already associated with session [NHibernate.Impl.SessionImpl (Worker Database synchronizer thread)]
10:24:21,912 [DEBUG] Updating:User[t_Eeye] Strategy [1] in database [Ecn.ElectronicEye.Server.PersistenceManager (Worker Database synchronizer thread)]
10:24:21,912 [DEBUG] object already associated with session [NHibernate.Impl.SessionImpl (Worker Database synchronizer thread)]
10:24:21,912 [DEBUG] Updating:User[t_Eeye] Strategy [1] in database [Ecn.ElectronicEye.Server.PersistenceManager (Worker Database synchronizer thread)]
10:24:21,912 [DEBUG] object already associated with session [NHibernate.Impl.SessionImpl (Worker Database synchronizer thread)]
10:24:21,912 [DEBUG] Updating:User[t_Eeye] Strategy [1] in database [Ecn.ElectronicEye.Server.PersistenceManager (Worker Database synchronizer thread)]
10:24:21,912 [DEBUG] object already associated with session [NHibernate.Impl.SessionImpl (Worker Database synchronizer thread)]
10:24:21,912 [DEBUG] Updating:User[t_Eeye] Strategy [1] in database [Ecn.ElectronicEye.Server.PersistenceManager (Worker Database synchronizer thread)]
10:24:21,912 [DEBUG] object already associated with session [NHibernate.Impl.SessionImpl (Worker Database synchronizer thread)]
10:24:21,927 [DEBUG] flushing session [NHibernate.Impl.SessionImpl (Worker Database synchronizer thread)]
10:24:21,927 [DEBUG] processing cascades for: Ecn.ElectronicEye.NHibernateMappingClass.DatabaseStrategy [NHibernate.Engine.Cascades (Worker Database synchronizer thread)]
10:24:21,927 [DEBUG] cascading to collection: Ecn.ElectronicEye.NHibernateMappingClass.DatabaseStrategy.Orders [NHibernate.Engine.Cascades (Worker Database synchronizer thread)]
10:24:21,927 [DEBUG] cascading to SaveOrUpdate() [NHibernate.Engine.Cascades (Worker Database synchronizer thread)]
10:24:21,927 [DEBUG] SaveOrUpdate() persistent instance [NHibernate.Impl.SessionImpl (Worker Database synchronizer thread)]
10:24:21,927 [DEBUG] cascading to SaveOrUpdate() [NHibernate.Engine.Cascades (Worker Database synchronizer thread)]
10:24:21,927 [DEBUG] SaveOrUpdate() persistent instance [NHibernate.Impl.SessionImpl (Worker Database synchronizer thread)]
10:24:21,927 [DEBUG] done processing cascades for: Ecn.ElectronicEye.NHibernateMappingClass.DatabaseStrategy [NHibernate.Engine.Cascades (Worker Database synchronizer thread)]
10:24:21,927 [DEBUG] Flushing entities and processing referenced collections [NHibernate.Impl.SessionImpl (Worker Database synchronizer thread)]
10:24:21,927 [DEBUG] Processing collection for role Ecn.ElectronicEye.NHibernateMappingClass.DatabaseStrategy.Orders [NHibernate.Impl.AbstractVisitor (Worker Database synchronizer thread)]
10:24:21,927 [DEBUG] Collection found: [Ecn.ElectronicEye.NHibernateMappingClass.DatabaseStrategy.Orders#Ecn.ElectronicEye.NHibernateMappingClass.StrategyCompositeId], was: [<unreferenced>] [NHibernate.Impl.SessionImpl (Worker Database synchronizer thread)]
10:24:21,927 [DEBUG] Updating entity: [Ecn.ElectronicEye.NHibernateMappingClass.DatabaseOrder#Ecn.ElectronicEye.NHibernateMappingClass.OrderCompositeId] [NHibernate.Impl.SessionImpl (Worker Database synchronizer thread)]
10:24:21,943 [DEBUG] Updating entity: [Ecn.ElectronicEye.NHibernateMappingClass.DatabaseOrder#Ecn.ElectronicEye.NHibernateMappingClass.OrderCompositeId] [NHibernate.Impl.SessionImpl (Worker Database synchronizer thread)]
10:24:21,943 [DEBUG] Processing unreferenced collections [NHibernate.Impl.SessionImpl (Worker Database synchronizer thread)]
10:24:21,943 [DEBUG] scheduling collection removes/(re)creates/updates [NHibernate.Impl.SessionImpl (Worker Database synchronizer thread)]
10:24:21,943 [DEBUG] Flushed: 1 insertions, 2 updates, 0 deletions to 3 objects [NHibernate.Impl.SessionImpl (Worker Database synchronizer thread)]
10:24:21,943 [DEBUG] Flushed: 1 (re)creations, 0 updates, 0 removals to 1 collections [NHibernate.Impl.SessionImpl (Worker Database synchronizer thread)]
10:24:21,943 [DEBUG] listing entities: [NHibernate.Impl.Printer (Worker Database synchronizer thread)]
10:24:21,943 [DEBUG] Ecn.ElectronicEye.NHibernateMappingClass.DatabaseOrder{EboxReference=null, Quantity=100, Price=110, Way=1, ExecutedQuantity=100, LastError=null, CreationDate=14/12/07, ExecutionAveragePrice=110, UniqueId=OrderCompositeId{StrategyId=1, OrderId=1, User=t_Eeye}} [NHibernate.Impl.Printer (Worker Database synchronizer thread)]
10:24:21,943 [DEBUG] Ecn.ElectronicEye.NHibernateMappingClass.DatabaseStrategy{Orders=[DatabaseOrder#OrderCompositeId{StrategyId=1, OrderId=1, User=t_Eeye}, DatabaseOrder#OrderCompositeId{StrategyId=1, OrderId=2, User=t_Eeye}], Name=, Activated=True, Parameters=CodInsA=7099464|CodInsB=7528981|MarketA=Z|MarketB=Z|MarketNameA=Eurex|MarketNameB=Eurex|MarketSectorA=|MarketSectorB=|MarketSegmentA=FUTURES|MarketSegmentB=FUTURES|QuantityA=100|QuotationType=0|RateA=1|RateB=1|Restriction=AllOrNothing|Threshold=1|, Inventory=SentSell=0|SentBuy=0|TotalSell=100|TotalBuy=100|PriceDelta=0|Threshold=1|, UniqueId=StrategyCompositeId{Id=1, User=t_Eeye}, Type=0} [NHibernate.Impl.Printer (Worker Database synchronizer thread)]
10:24:21,943 [DEBUG] Ecn.ElectronicEye.NHibernateMappingClass.DatabaseOrder{EboxReference=null, Quantity=100, Price=99, Way=0, ExecutedQuantity=100, LastError=null, CreationDate=14/12/07, ExecutionAveragePrice=99, UniqueId=OrderCompositeId{StrategyId=1, OrderId=2, User=t_Eeye}} [NHibernate.Impl.Printer (Worker Database synchronizer thread)]
10:24:21,943 [DEBUG] executing flush [NHibernate.Impl.SessionImpl (Worker Database synchronizer thread)]
10:24:21,943 [DEBUG] registering flush begin [NHibernate.Impl.ConnectionManager (Worker Database synchronizer thread)]
10:24:21,959 [DEBUG] Inserting entity: [Ecn.ElectronicEye.NHibernateMappingClass.DatabaseStrategy#Ecn.ElectronicEye.NHibernateMappingClass.StrategyCompositeId] [NHibernate.Persister.Entity.AbstractEntityPersister (Worker Database synchronizer thread)]
10:24:21,959 [DEBUG] Opened new IDbCommand, open IDbCommands: 1 [NHibernate.Impl.BatcherImpl (Worker Database synchronizer thread)]
10:24:21,959 [DEBUG] Building an IDbCommand object for the SqlString: INSERT INTO TSTREYEEMS (Parameters, Inventory, Activated, Name, STRAT_TYPE, USER_ID, id) VALUES (?, ?, ?, ?, ?, ?, ?) [NHibernate.Impl.BatcherImpl (Worker Database synchronizer thread)]
10:24:21,959 [DEBUG] Dehydrating entity: [Ecn.ElectronicEye.NHibernateMappingClass.DatabaseStrategy#Ecn.ElectronicEye.NHibernateMappingClass.StrategyCompositeId] [NHibernate.Persister.Entity.AbstractEntityPersister (Worker Database synchronizer thread)]
10:24:21,959 [DEBUG] binding 'CodInsA=7099464|CodInsB=7528981|MarketA=Z|MarketB=Z|MarketNameA=Eurex|MarketNameB=Eurex|MarketSectorA=|MarketSectorB=|MarketSegmentA=FUTURES|MarketSegmentB=FUTURES|QuantityA=100|QuotationType=0|RateA=1|RateB=1|Restriction=AllOrNothing|Threshold=1|' to parameter: 0 [NHibernate.Type.StringType (Worker Database synchronizer thread)]
10:24:21,959 [DEBUG] binding 'SentSell=0|SentBuy=0|TotalSell=100|TotalBuy=100|PriceDelta=0|Threshold=1|' to parameter: 1 [NHibernate.Type.StringType (Worker Database synchronizer thread)]
10:24:21,959 [DEBUG] binding 'True' to parameter: 2 [NHibernate.Type.BooleanType (Worker Database synchronizer thread)]
10:24:21,959 [DEBUG] binding '' to parameter: 3 [NHibernate.Type.StringType (Worker Database synchronizer thread)]
10:24:21,959 [DEBUG] binding '0' to parameter: 4 [NHibernate.Type.PersistentEnumType (Worker Database synchronizer thread)]
10:24:21,959 [DEBUG] binding 't_Eeye' to parameter: 5 [NHibernate.Type.StringType (Worker Database synchronizer thread)]
10:24:21,959 [DEBUG] binding '1' to parameter: 6 [NHibernate.Type.Int32Type (Worker Database synchronizer thread)]
10:24:21,959 [DEBUG] INSERT INTO TSTREYEEMS (Parameters, Inventory, Activated, Name, STRAT_TYPE, USER_ID, id) VALUES (:p0, :p1, :p2, :p3, :p4, :p5, :p6); :p0 = 'CodInsA=7099464|CodInsB=7528981|MarketA=Z|MarketB=Z|MarketNameA=Eurex|MarketNameB=Eurex|MarketSectorA=|MarketSectorB=|MarketSegmentA=FUTURES|MarketSegmentB=FUTURES|QuantityA=100|QuotationType=0|RateA=1|RateB=1|Restriction=AllOrNothing|Threshold=1|', :p1 = 'SentSell=0|SentBuy=0|TotalSell=100|TotalBuy=100|PriceDelta=0|Threshold=1|', :p2 = 'True', :p3 = '', :p4 = 'TwoInstrumentsSwitch', :p5 = 't_Eeye', :p6 = '1' [NHibernate.SQL (Worker Database synchronizer thread)]
10:24:21,974 [DEBUG] Closed IDbCommand, open IDbCommands: 0 [NHibernate.Impl.BatcherImpl (Worker Database synchronizer thread)]
10:24:21,990 [DEBUG] Updating entity: [Ecn.ElectronicEye.NHibernateMappingClass.DatabaseOrder#Ecn.ElectronicEye.NHibernateMappingClass.OrderCompositeId] [NHibernate.Persister.Entity.AbstractEntityPersister (Worker Database synchronizer thread)]
10:24:21,990 [DEBUG] Opened new IDbCommand, open IDbCommands: 1 [NHibernate.Impl.BatcherImpl (Worker Database synchronizer thread)]
10:24:21,990 [DEBUG] Building an IDbCommand object for the SqlString: UPDATE TORDEYEEMS SET EBOX_REF = ?, Price = ?, Qty = ?, LAST_ERROR = ?, EXE_QTY = ?, EXE_AVG_PRICE = ?, CREATE_DATE = ?, Way = ? WHERE USER_ID = ? AND ORDER_ID = ? AND STRATEGY_ID = ? [NHibernate.Impl.BatcherImpl (Worker Database synchronizer thread)]
10:24:21,990 [DEBUG] Dehydrating entity: [Ecn.ElectronicEye.NHibernateMappingClass.DatabaseOrder#Ecn.ElectronicEye.NHibernateMappingClass.OrderCompositeId] [NHibernate.Persister.Entity.AbstractEntityPersister (Worker Database synchronizer thread)]
10:24:21,990 [DEBUG] binding null to parameter: 0 [NHibernate.Type.StringType (Worker Database synchronizer thread)]
10:24:21,990 [DEBUG] binding '110' to parameter: 1 [NHibernate.Type.DecimalType (Worker Database synchronizer thread)]
10:24:21,990 [DEBUG] binding '100' to parameter: 2 [NHibernate.Type.DecimalType (Worker Database synchronizer thread)]
10:24:21,990 [DEBUG] binding null to parameter: 3 [NHibernate.Type.StringType (Worker Database synchronizer thread)]
10:24:21,990 [DEBUG] binding '100' to parameter: 4 [NHibernate.Type.Int64Type (Worker Database synchronizer thread)]
10:24:21,990 [DEBUG] binding '110' to parameter: 5 [NHibernate.Type.DecimalType (Worker Database synchronizer thread)]
10:24:21,990 [DEBUG] binding '14/12/07' to parameter: 6 [NHibernate.Type.DateTimeType (Worker Database synchronizer thread)]
10:24:21,990 [DEBUG] binding '1' to parameter: 7 [NHibernate.Type.PersistentEnumType (Worker Database synchronizer thread)]
10:24:21,990 [DEBUG] binding 't_Eeye' to parameter: 8 [NHibernate.Type.StringType (Worker Database synchronizer thread)]
10:24:21,990 [DEBUG] binding '1' to parameter: 9 [NHibernate.Type.Int32Type (Worker Database synchronizer thread)]
10:24:21,990 [DEBUG] binding '1' to parameter: 10 [NHibernate.Type.Int32Type (Worker Database synchronizer thread)]
10:24:21,990 [DEBUG] UPDATE TORDEYEEMS SET EBOX_REF = :p0, Price = :p1, Qty = :p2, LAST_ERROR = :p3, EXE_QTY = :p4, EXE_AVG_PRICE = :p5, CREATE_DATE = :p6, Way = :p7 WHERE USER_ID = :p8 AND ORDER_ID = :p9 AND STRATEGY_ID = :p10; :p0 = '', :p1 = '110', :p2 = '100', :p3 = '', :p4 = '100', :p5 = '110', :p6 = '14/12/07 10:24:20 ', :p7 = 'Sell', :p8 = 't_Eeye', :p9 = '1', :p10 = '1' [NHibernate.SQL (Worker Database synchronizer thread)]
10:24:22,021 [DEBUG] Closed IDbCommand, open IDbCommands: 0 [NHibernate.Impl.BatcherImpl (Worker Database synchronizer thread)]
10:24:22,037 [ERROR] could not synchronize database state with session [NHibernate.Impl.SessionImpl (Worker Database synchronizer thread)] NHibernate.StaleStateException: Unexpected row count: 0; expected: 1 at NHibernate.AdoNet.Expectations.BasicExpectation.VerifyOutcomeNonBatched(Int32 rowCount, IDbCommand statement) at NHibernate.Impl.NonBatchingBatcher.AddToBatch(IExpectation expectation) at NHibernate.Persister.Entity.AbstractEntityPersister.Update(Object id, Object[] fields, Object[] oldFields, Boolean[] includeProperty, Int32 j, Object oldVersion, Object obj, SqlCommandInfo sql, ISessionImplementor session) at NHibernate.Persister.Entity.AbstractEntityPersister.Update(Object id, Object[] fields, Int32[] dirtyFields, Boolean hasDirtyCollection, 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() 10:24:22,037 [DEBUG] registering flush end [NHibernate.Impl.ConnectionManager (Worker Database synchronizer thread)] [color=red]10:24:22,037 [ERROR] Database update failed [Ecn.ElectronicEye.Server.PersistenceManager (Worker Database synchronizer thread)] NHibernate.StaleStateException: Unexpected row count: 0; expected: 1 at NHibernate.AdoNet.Expectations.BasicExpectation.VerifyOutcomeNonBatched(Int32 rowCount, IDbCommand statement) at NHibernate.Impl.NonBatchingBatcher.AddToBatch(IExpectation expectation) at NHibernate.Persister.Entity.AbstractEntityPersister.Update(Object id, Object[] fields, Object[] oldFields, Boolean[] includeProperty, Int32 j, Object oldVersion, Object obj, SqlCommandInfo sql, ISessionImplementor session) at NHibernate.Persister.Entity.AbstractEntityPersister.Update(Object id, Object[] fields, Int32[] dirtyFields, Boolean hasDirtyCollection, 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() at NHibernate.Impl.SessionImpl.Flush() at Ecn.ElectronicEye.Server.PersistenceManager.ProcessSynchronisation(Object state) in M:\nla_EMS_EEYE\EMP\Projects\ElectronicEye\Server\Persistence\PersistenceManager.cs:line 25510:24:22,052 [DEBUG] rollback [NHibernate.Transaction.AdoTransaction (Worker Database synchronizer thread)][/color]
10:24:22,068 [DEBUG] running AdoTransaction.Dispose() [NHibernate.Transaction.AdoTransaction (Worker Database synchronizer thread)]
10:24:22,068 [DEBUG] aggressively releasing database connection [NHibernate.Impl.ConnectionManager (Worker Database synchronizer thread)]
10:24:22,068 [DEBUG] Closing connection [NHibernate.Connection.ConnectionProvider (Worker Database synchronizer thread)]
10:24:22,068 [DEBUG] transaction completion [NHibernate.Impl.SessionImpl (Worker Database synchronizer thread)]
10:24:22,068 [DEBUG] closing session [NHibernate.Impl.SessionImpl (Worker Database synchronizer thread)]
10:24:22,068 [DEBUG] running BatcherImpl.Dispose(true) [NHibernate.Impl.BatcherImpl (Worker Database synchronizer thread)]
10:24:22,068 [DEBUG] running ISession.Dispose() [NHibernate.Impl.SessionImpl (Worker Database synchronizer thread)]
10:24:22,068 [DEBUG] closing session [NHibernate.Impl.SessionImpl (Worker Database synchronizer thread)]
10:24:22,068 [DEBUG] running BatcherImpl.Dispose(true) [NHibernate.Impl.BatcherImpl (Worker Database synchronizer thread)]
10:24:22,896 [DEBUG] strategy 1 wanted qty on sell 100, exposed qty on Sell:100, wanted qty on buy 100,exposed qty on buy 100 [Ecn.ElectronicEye.ServerStrategy.TwoInstrumentsSwitchStrategy (3040)]
10:24:22,896 [INFO ] Strategy 1 is now disable [Ecn.ElectronicEye.ServerStrategy.TwoInstrumentsSwitchStrategy (HighPerformancePool #4)]
10:24:22,896 [DEBUG] Save or Update strategy 1 to database [Ecn.ElectronicEye.Server.PersistentStrategy (HighPerformancePool #4)]
10:24:22,896 [DEBUG] ask to updating data in database [Ecn.ElectronicEye.Server.PersistenceManager (HighPerformancePool #4)]
10:24:22,896 [DEBUG] Socket (127.0.0.1:2958): Message (size:641) sent [Iaplus.Transport.Connection (1588)]
10:24:23,021 [DEBUG] Socket (127.0.0.1:2958): Message (size:4) sent [Iaplus.Transport.Connection (1588)]
10:24:27,896 [DEBUG] Processing database synchronisation [Ecn.ElectronicEye.Server.PersistenceManager (Worker Database synchronizer thread)]
10:24:27,896 [DEBUG] opened session [NHibernate.Impl.SessionImpl (Worker Database synchronizer thread)]
10:24:27,896 [DEBUG] begin [NHibernate.Transaction.AdoTransaction (Worker Database synchronizer thread)]
10:24:27,896 [DEBUG] Obtaining IDbConnection from Driver [NHibernate.Connection.DriverConnectionProvider (Worker Database synchronizer thread)]
10:24:27,896 [DEBUG] Updating:User[t_Eeye] Strategy [1] in database [Ecn.ElectronicEye.Server.PersistenceManager (Worker Database synchronizer thread)]
10:24:27,896 [DEBUG] updating [Ecn.ElectronicEye.NHibernateMappingClass.DatabaseStrategy#Ecn.ElectronicEye.NHibernateMappingClass.StrategyCompositeId] [NHibernate.Impl.SessionImpl (Worker Database synchronizer thread)]
10:24:27,896 [DEBUG] collection dereferenced while transient [Ecn.ElectronicEye.NHibernateMappingClass.DatabaseStrategy.Orders#Ecn.ElectronicEye.NHibernateMappingClass.StrategyCompositeId] [NHibernate.Impl.SessionImpl (Worker Database synchronizer thread)]
10:24:27,912 [DEBUG] processing cascades for: Ecn.ElectronicEye.NHibernateMappingClass.DatabaseStrategy [NHibernate.Engine.Cascades (Worker Database synchronizer thread)]
10:24:27,912 [DEBUG] cascading to collection: Ecn.ElectronicEye.NHibernateMappingClass.DatabaseStrategy.Orders [NHibernate.Engine.Cascades (Worker Database synchronizer thread)]
10:24:27,912 [DEBUG] cascading to SaveOrUpdate() [NHibernate.Engine.Cascades (Worker Database synchronizer thread)]
10:24:27,912 [DEBUG] unsaved-value strategy NONE [NHibernate.Engine.Cascades (Worker Database synchronizer thread)]
10:24:27,912 [DEBUG] SaveOrUpdate() previously saved instance with id: Ecn.ElectronicEye.NHibernateMappingClass.OrderCompositeId [NHibernate.Impl.SessionImpl (Worker Database synchronizer thread)]
10:24:27,912 [DEBUG] updating [Ecn.ElectronicEye.NHibernateMappingClass.DatabaseOrder#Ecn.ElectronicEye.NHibernateMappingClass.OrderCompositeId] [NHibernate.Impl.SessionImpl (Worker Database synchronizer thread)]
10:24:27,912 [DEBUG] cascading to SaveOrUpdate() [NHibernate.Engine.Cascades (Worker Database synchronizer thread)]
10:24:27,912 [DEBUG] unsaved-value strategy NONE [NHibernate.Engine.Cascades (Worker Database synchronizer thread)]
10:24:27,912 [DEBUG] SaveOrUpdate() previously saved instance with id: Ecn.ElectronicEye.NHibernateMappingClass.OrderCompositeId [NHibernate.Impl.SessionImpl (Worker Database synchronizer thread)]
10:24:27,912 [DEBUG] updating [Ecn.ElectronicEye.NHibernateMappingClass.DatabaseOrder#Ecn.ElectronicEye.NHibernateMappingClass.OrderCompositeId] [NHibernate.Impl.SessionImpl (Worker Database synchronizer thread)]
10:24:27,912 [ERROR] An AssertionFailure occured - this may indicate a bug in NHibernate [NHibernate.AssertionFailure (Worker Database synchronizer thread)] NHibernate.AssertionFailure: no collection snapshot for orphan delete
10:24:27,943 [DEBUG] flushing session [NHibernate.Impl.SessionImpl (Worker Database synchronizer thread)]
10:24:27,943 [DEBUG] processing cascades for: Ecn.ElectronicEye.NHibernateMappingClass.DatabaseStrategy [NHibernate.Engine.Cascades (Worker Database synchronizer thread)]
10:24:27,943 [DEBUG] cascading to collection: Ecn.ElectronicEye.NHibernateMappingClass.DatabaseStrategy.Orders [NHibernate.Engine.Cascades (Worker Database synchronizer thread)]
10:24:27,943 [DEBUG] cascading to SaveOrUpdate() [NHibernate.Engine.Cascades (Worker Database synchronizer thread)]
10:24:27,943 [DEBUG] SaveOrUpdate() persistent instance [NHibernate.Impl.SessionImpl (Worker Database synchronizer thread)]
10:24:27,943 [DEBUG] cascading to SaveOrUpdate() [NHibernate.Engine.Cascades (Worker Database synchronizer thread)]
10:24:27,943 [DEBUG] SaveOrUpdate() persistent instance [NHibernate.Impl.SessionImpl (Worker Database synchronizer thread)]
10:24:27,943 [ERROR] An AssertionFailure occured - this may indicate a bug in NHibernate [NHibernate.AssertionFailure (Worker Database synchronizer thread)] NHibernate.AssertionFailure: no collection snapshot for orphan delete
Name and version of the database you are using:
Oracle 10g
The generated SQL (show_sql=true):
see below in log
Debug level Hibernate log excerpt:
see below
|