我正在使用nHibernate属性来生成这个......
<class name="xxx.Message.MtMessage, xxx" lazy="false" table="tblCore_MtMessage">
<id name="MtMessageId">
<generator class="identity" />
</id>
<property name="MtMessageStatus" />
<property name="ApplicationMessageId" />
<property name="IsPremium" />
<property name="Tariff" />
<property name="ExpiryTimeMinutes" />
<property name="PhoneNetwork" />
<property name="MessageText" />
<property name="ToNumber" />
<property name="FromNumber" />
<property name="IsCompleted" />
<property name="UpdateDate" />
<many-to-one name="Category" class="xxx.Category, xxx" column="CategoryId" not-null="true" cascade="None" />
<many-to-one name="Aggregator" class="xxx.AbstractAggregator, xxx" column="AggregatorId" cascade="None" />
<many-to-one name="Aggregator" class="xxx.AbstractAggregator, xxx" column="AggregatorId" cascade="None" />
<many-to-one name="Application" class="xxx.Application, xxx" column="ApplicationId" cascade="None" />
<many-to-one name="Application" class="xxx.Application, xxx" column="ApplicationId" cascade="None" />
<bag name="Segments" lazy="false" inverse="true" cascade="None">
<key column="MtMessageId" />
<one-to-many class="xxx.Message.MtSegment, xxx" />
</bag>
</class>
<class name="xxx.Message.MoMessage, xxx" lazy="false" table="tblCore_MoMessage">
<id name="MoMessageId">
<generator class="identity" />
</id>
<property name="MoMessageStatus" />
<property name="PhoneNetwork" />
<property name="MessageText" />
<property name="ToNumber" />
<property name="FromNumber" />
<property name="IsCompleted" />
<property name="UpdateDate" />
<list name="Segments" lazy="false" inverse="true" cascade="None">
<key column="MoMessageId" />
<index column="SegmentNumber" />
<one-to-many class="xxx.Message.MoSegment, xxx" />
</list>
</class>
出于某种原因,当我创建一个新的MoMessage并在其上调用ISession.Save()时,nHibernate尝试UPDATE而不是INSERT。我没有问题保存MtMessage。我已经尝试更改包的列表,因为这是唯一真正的区别,但是没有用。任何人都有任何指针从哪里开始寻找???
这是一个很有帮助的日志记录
2010-09-09 18:53:54,015 DEBUG xxx.NHibernate.ReceiveMoUow - Saving message[Id:0,Type:MO,To:89000,From:447000000000,Network:O2,Status:New,Text:Hi mum]
2010-09-09 18:53:54,031 DEBUG xxx.Persist.NHibernateConnection - CreateSession(Commit)
2010-09-09 18:53:54,031 DEBUG NHibernate.Impl.SessionImpl - [session-id=408ca207-0ed1-487f-b57b-ae6a072a4d3f] opened session at timestamp: 634196552340, for session factory: [/0754517161044239b072f9d048fcb17f]
2010-09-09 18:53:54,031 DEBUG NHibernate.Loader.Criteria.CriteriaQueryTranslator - put criteria=PhoneNumber = 447000000000 and IsEnabled = True alias=this0_
2010-09-09 18:53:54,031 DEBUG NHibernate.Loader.Criteria.CriteriaQueryTranslator - returning alias=this_ for criteria=PhoneNumber = 447000000000 and IsEnabled = True
2010-09-09 18:53:54,031 DEBUG NHibernate.Loader.Criteria.CriteriaQueryTranslator - returning alias=this_ for criteria=PhoneNumber = 447000000000 and IsEnabled = True
2010-09-09 18:53:54,031 DEBUG NHibernate.Loader.Criteria.CriteriaQueryTranslator - getCriteria for path=Application crit=
2010-09-09 18:53:54,031 DEBUG NHibernate.Loader.Criteria.CriteriaQueryTranslator - getCriteria for path=Application.RedirectApplication crit=
2010-09-09 18:53:54,031 DEBUG NHibernate.SqlCommand.SqlSelectBuilder - The initial capacity was set too low at: 12 for the SelectSqlBuilder that needed a capacity of: 16 for the table dbo.tblCore_PhoneDiverts this_
2010-09-09 18:53:54,031 DEBUG NHibernate.AdoNet.AbstractBatcher - Opened new IDbCommand, open IDbCommands: 1
2010-09-09 18:53:54,031 DEBUG NHibernate.AdoNet.AbstractBatcher - Building an IDbCommand object for the SqlString: SELECT this_.PhoneNumber as PhoneNum1_9_2_, this_.DivertName as DivertName9_2_, this_.IsEnabled as IsEnabled9_2_, this_.UpdateDate as UpdateDate9_2_, this_.ApplicationId as Applicat5_9_2_, applicatio2_.ApplicationId as Applicat1_3_0_, applicatio2_.ApplicationName as Applicat2_3_0_, applicatio2_.ValidationKey as Validati3_3_0_, applicatio2_.ApplicationWebInterfaceUrl as Applicat4_3_0_, applicatio2_.IpAddress as IpAddress3_0_, applicatio2_.ApplicationWebInterfaceVersion as Applicat6_3_0_, applicatio2_.ShouldSend as ShouldSend3_0_, applicatio2_.ShouldRedirect as ShouldRe8_3_0_, applicatio2_.ShouldDumpMessage as ShouldDu9_3_0_, applicatio2_.UpdateDate as UpdateDate3_0_, applicatio2_.RedirectApplicationId as Redirec11_3_0_, applicatio3_.ApplicationId as Applicat1_3_1_, applicatio3_.ApplicationName as Applicat2_3_1_, applicatio3_.ValidationKey as Validati3_3_1_, applicatio3_.ApplicationWebInterfaceUrl as Applicat4_3_1_, applicatio3_.IpAddress as IpAddress3_1_, applicatio3_.ApplicationWebInterfaceVersion as Applicat6_3_1_, applicatio3_.ShouldSend as ShouldSend3_1_, applicatio3_.ShouldRedirect as ShouldRe8_3_1_, applicatio3_.ShouldDumpMessage as ShouldDu9_3_1_, applicatio3_.UpdateDate as UpdateDate3_1_, applicatio3_.RedirectApplicationId as Redirec11_3_1_ FROM dbo.tblCore_PhoneDiverts this_ left outer join dbo.tblCore_Applications applicatio2_ on this_.ApplicationId=applicatio2_.ApplicationId left outer join dbo.tblCore_Applications applicatio3_ on applicatio2_.RedirectApplicationId=applicatio3_.ApplicationId WHERE this_.PhoneNumber = ? and this_.IsEnabled = ?
2010-09-09 18:53:54,031 DEBUG NHibernate.Engine.QueryParameters - BindParameters(Named:NHibernate.Type.StringType) 447000000000 -> [0]
2010-09-09 18:53:54,031 DEBUG NHibernate.Type.StringType - binding '447000000000' to parameter: 0
2010-09-09 18:53:54,031 DEBUG NHibernate.Engine.QueryParameters - BindParameters(Named:NHibernate.Type.BooleanType) True -> [1]
2010-09-09 18:53:54,031 DEBUG NHibernate.Type.BooleanType - binding 'True' to parameter: 1
2010-09-09 18:53:54,031 INFO NHibernate.Loader.Loader - SELECT this_.PhoneNumber as PhoneNum1_9_2_, this_.DivertName as DivertName9_2_, this_.IsEnabled as IsEnabled9_2_, this_.UpdateDate as UpdateDate9_2_, this_.ApplicationId as Applicat5_9_2_, applicatio2_.ApplicationId as Applicat1_3_0_, applicatio2_.ApplicationName as Applicat2_3_0_, applicatio2_.ValidationKey as Validati3_3_0_, applicatio2_.ApplicationWebInterfaceUrl as Applicat4_3_0_, applicatio2_.IpAddress as IpAddress3_0_, applicatio2_.ApplicationWebInterfaceVersion as Applicat6_3_0_, applicatio2_.ShouldSend as ShouldSend3_0_, applicatio2_.ShouldRedirect as ShouldRe8_3_0_, applicatio2_.ShouldDumpMessage as ShouldDu9_3_0_, applicatio2_.UpdateDate as UpdateDate3_0_, applicatio2_.RedirectApplicationId as Redirec11_3_0_, applicatio3_.ApplicationId as Applicat1_3_1_, applicatio3_.ApplicationName as Applicat2_3_1_, applicatio3_.ValidationKey as Validati3_3_1_, applicatio3_.ApplicationWebInterfaceUrl as Applicat4_3_1_, applicatio3_.IpAddress as IpAddress3_1_, applicatio3_.ApplicationWebInterfaceVersion as Applicat6_3_1_, applicatio3_.ShouldSend as ShouldSend3_1_, applicatio3_.ShouldRedirect as ShouldRe8_3_1_, applicatio3_.ShouldDumpMessage as ShouldDu9_3_1_, applicatio3_.UpdateDate as UpdateDate3_1_, applicatio3_.RedirectApplicationId as Redirec11_3_1_ FROM dbo.tblCore_PhoneDiverts this_ left outer join dbo.tblCore_Applications applicatio2_ on this_.ApplicationId=applicatio2_.ApplicationId left outer join dbo.tblCore_Applications applicatio3_ on applicatio2_.RedirectApplicationId=applicatio3_.ApplicationId WHERE this_.PhoneNumber = @p0 and this_.IsEnabled = @p1
2010-09-09 18:53:54,031 DEBUG NHibernate.SQL - SELECT this_.PhoneNumber as PhoneNum1_9_2_, this_.DivertName as DivertName9_2_, this_.IsEnabled as IsEnabled9_2_, this_.UpdateDate as UpdateDate9_2_, this_.ApplicationId as Applicat5_9_2_, applicatio2_.ApplicationId as Applicat1_3_0_, applicatio2_.ApplicationName as Applicat2_3_0_, applicatio2_.ValidationKey as Validati3_3_0_, applicatio2_.ApplicationWebInterfaceUrl as Applicat4_3_0_, applicatio2_.IpAddress as IpAddress3_0_, applicatio2_.ApplicationWebInterfaceVersion as Applicat6_3_0_, applicatio2_.ShouldSend as ShouldSend3_0_, applicatio2_.ShouldRedirect as ShouldRe8_3_0_, applicatio2_.ShouldDumpMessage as ShouldDu9_3_0_, applicatio2_.UpdateDate as UpdateDate3_0_, applicatio2_.RedirectApplicationId as Redirec11_3_0_, applicatio3_.ApplicationId as Applicat1_3_1_, applicatio3_.ApplicationName as Applicat2_3_1_, applicatio3_.ValidationKey as Validati3_3_1_, applicatio3_.ApplicationWebInterfaceUrl as Applicat4_3_1_, applicatio3_.IpAddress as IpAddress3_1_, applicatio3_.ApplicationWebInterfaceVersion as Applicat6_3_1_, applicatio3_.ShouldSend as ShouldSend3_1_, applicatio3_.ShouldRedirect as ShouldRe8_3_1_, applicatio3_.ShouldDumpMessage as ShouldDu9_3_1_, applicatio3_.UpdateDate as UpdateDate3_1_, applicatio3_.RedirectApplicationId as Redirec11_3_1_ FROM dbo.tblCore_PhoneDiverts this_ left outer join dbo.tblCore_Applications applicatio2_ on this_.ApplicationId=applicatio2_.ApplicationId left outer join dbo.tblCore_Applications applicatio3_ on applicatio2_.RedirectApplicationId=applicatio3_.ApplicationId WHERE this_.PhoneNumber = @p0 and this_.IsEnabled = @p1;@p0 = '447000000000', @p1 = True
2010-09-09 18:53:54,031 DEBUG NHibernate.Connection.DriverConnectionProvider - Obtaining IDbConnection from Driver
2010-09-09 18:53:54,031 DEBUG NHibernate.AdoNet.AbstractBatcher - ExecuteReader took 1 ms
2010-09-09 18:53:54,031 DEBUG NHibernate.AdoNet.AbstractBatcher - Opened IDataReader, open IDataReaders: 1
2010-09-09 18:53:54,031 DEBUG NHibernate.Loader.Loader - processing result set
2010-09-09 18:53:54,031 DEBUG NHibernate.Loader.Loader - done processing result set (0 rows)
2010-09-09 18:53:54,031 DEBUG NHibernate.Driver.NHybridDataReader - running NHybridDataReader.Dispose()
2010-09-09 18:53:54,031 DEBUG NHibernate.AdoNet.AbstractBatcher - Closed IDataReader, open IDataReaders :0
2010-09-09 18:53:54,031 DEBUG NHibernate.AdoNet.AbstractBatcher - DataReader was closed after 1 ms
2010-09-09 18:53:54,031 DEBUG NHibernate.AdoNet.AbstractBatcher - Closed IDbCommand, open IDbCommands: 0
2010-09-09 18:53:54,031 DEBUG NHibernate.AdoNet.ConnectionManager - aggressively releasing database connection
2010-09-09 18:53:54,031 DEBUG NHibernate.Connection.ConnectionProvider - Closing connection
2010-09-09 18:53:54,031 DEBUG NHibernate.Loader.Loader - total objects hydrated: 0
2010-09-09 18:53:54,031 DEBUG NHibernate.Engine.StatefulPersistenceContext - initializing non-lazy collections
2010-09-09 18:53:54,031 DEBUG NHibernate.AdoNet.ConnectionManager - after autocommit
2010-09-09 18:53:54,031 DEBUG NHibernate.Impl.SessionImpl - transaction completion
2010-09-09 18:53:54,031 DEBUG NHibernate.AdoNet.ConnectionManager - aggressively releasing database connection
2010-09-09 18:53:54,031 DEBUG NHibernate.Impl.SessionImpl - [session-id=408ca207-0ed1-487f-b57b-ae6a072a4d3f] running ISession.Dispose()
2010-09-09 18:53:54,031 DEBUG NHibernate.Impl.SessionImpl - [session-id=408ca207-0ed1-487f-b57b-ae6a072a4d3f] executing real Dispose(True)
2010-09-09 18:53:54,031 DEBUG NHibernate.Impl.SessionImpl - closing session
2010-09-09 18:53:54,031 DEBUG NHibernate.AdoNet.AbstractBatcher - running BatcherImpl.Dispose(true)
2010-09-09 18:53:54,031 DEBUG xxx.Persist.NHibernateConnection - CreateSession(Commit)
2010-09-09 18:53:54,031 DEBUG NHibernate.Impl.SessionImpl - [session-id=fce26533-bf6c-4f93-b75e-61a8c88c1e87] opened session at timestamp: 634196552340, for session factory: [/0754517161044239b072f9d048fcb17f]
2010-09-09 18:53:54,031 DEBUG NHibernate.Loader.Criteria.CriteriaQueryTranslator - put criteria=PhoneNetwork = O2 and IsEnabled = True alias=this0_
2010-09-09 18:53:54,031 DEBUG NHibernate.Loader.Criteria.CriteriaQueryTranslator - returning alias=this_ for criteria=PhoneNetwork = O2 and IsEnabled = True
2010-09-09 18:53:54,031 DEBUG NHibernate.Loader.Criteria.CriteriaQueryTranslator - returning alias=this_ for criteria=PhoneNetwork = O2 and IsEnabled = True
2010-09-09 18:53:54,031 DEBUG NHibernate.Loader.Criteria.CriteriaQueryTranslator - getCriteria for path=Application crit=
2010-09-09 18:53:54,031 DEBUG NHibernate.Loader.Criteria.CriteriaQueryTranslator - getCriteria for path=Application.RedirectApplication crit=
2010-09-09 18:53:54,031 DEBUG NHibernate.SqlCommand.SqlSelectBuilder - The initial capacity was set too low at: 12 for the SelectSqlBuilder that needed a capacity of: 16 for the table dbo.tblCore_NetworkDiverts this_
2010-09-09 18:53:54,031 DEBUG NHibernate.AdoNet.AbstractBatcher - Opened new IDbCommand, open IDbCommands: 1
2010-09-09 18:53:54,031 DEBUG NHibernate.AdoNet.AbstractBatcher - Building an IDbCommand object for the SqlString: SELECT this_.PhoneNetwork as PhoneNet1_13_2_, this_.IsEnabled as IsEnabled13_2_, this_.UpdateDate as UpdateDate13_2_, this_.ApplicationId as Applicat4_13_2_, applicatio2_.ApplicationId as Applicat1_3_0_, applicatio2_.ApplicationName as Applicat2_3_0_, applicatio2_.ValidationKey as Validati3_3_0_, applicatio2_.ApplicationWebInterfaceUrl as Applicat4_3_0_, applicatio2_.IpAddress as IpAddress3_0_, applicatio2_.ApplicationWebInterfaceVersion as Applicat6_3_0_, applicatio2_.ShouldSend as ShouldSend3_0_, applicatio2_.ShouldRedirect as ShouldRe8_3_0_, applicatio2_.ShouldDumpMessage as ShouldDu9_3_0_, applicatio2_.UpdateDate as UpdateDate3_0_, applicatio2_.RedirectApplicationId as Redirec11_3_0_, applicatio3_.ApplicationId as Applicat1_3_1_, applicatio3_.ApplicationName as Applicat2_3_1_, applicatio3_.ValidationKey as Validati3_3_1_, applicatio3_.ApplicationWebInterfaceUrl as Applicat4_3_1_, applicatio3_.IpAddress as IpAddress3_1_, applicatio3_.ApplicationWebInterfaceVersion as Applicat6_3_1_, applicatio3_.ShouldSend as ShouldSend3_1_, applicatio3_.ShouldRedirect as ShouldRe8_3_1_, applicatio3_.ShouldDumpMessage as ShouldDu9_3_1_, applicatio3_.UpdateDate as UpdateDate3_1_, applicatio3_.RedirectApplicationId as Redirec11_3_1_ FROM dbo.tblCore_NetworkDiverts this_ left outer join dbo.tblCore_Applications applicatio2_ on this_.ApplicationId=applicatio2_.ApplicationId left outer join dbo.tblCore_Applications applicatio3_ on applicatio2_.RedirectApplicationId=applicatio3_.ApplicationId WHERE this_.PhoneNetwork = ? and this_.IsEnabled = ?
2010-09-09 18:53:54,031 DEBUG NHibernate.Engine.QueryParameters - BindParameters(Named:NHibernate.Type.PersistentEnumType) O2 -> [0]
2010-09-09 18:53:54,031 DEBUG NHibernate.Type.PersistentEnumType - binding '0' to parameter: 0
2010-09-09 18:53:54,031 DEBUG NHibernate.Engine.QueryParameters - BindParameters(Named:NHibernate.Type.BooleanType) True -> [1]
2010-09-09 18:53:54,031 DEBUG NHibernate.Type.BooleanType - binding 'True' to parameter: 1
2010-09-09 18:53:54,031 INFO NHibernate.Loader.Loader - SELECT this_.PhoneNetwork as PhoneNet1_13_2_, this_.IsEnabled as IsEnabled13_2_, this_.UpdateDate as UpdateDate13_2_, this_.ApplicationId as Applicat4_13_2_, applicatio2_.ApplicationId as Applicat1_3_0_, applicatio2_.ApplicationName as Applicat2_3_0_, applicatio2_.ValidationKey as Validati3_3_0_, applicatio2_.ApplicationWebInterfaceUrl as Applicat4_3_0_, applicatio2_.IpAddress as IpAddress3_0_, applicatio2_.ApplicationWebInterfaceVersion as Applicat6_3_0_, applicatio2_.ShouldSend as ShouldSend3_0_, applicatio2_.ShouldRedirect as ShouldRe8_3_0_, applicatio2_.ShouldDumpMessage as ShouldDu9_3_0_, applicatio2_.UpdateDate as UpdateDate3_0_, applicatio2_.RedirectApplicationId as Redirec11_3_0_, applicatio3_.ApplicationId as Applicat1_3_1_, applicatio3_.ApplicationName as Applicat2_3_1_, applicatio3_.ValidationKey as Validati3_3_1_, applicatio3_.ApplicationWebInterfaceUrl as Applicat4_3_1_, applicatio3_.IpAddress as IpAddress3_1_, applicatio3_.ApplicationWebInterfaceVersion as Applicat6_3_1_, applicatio3_.ShouldSend as ShouldSend3_1_, applicatio3_.ShouldRedirect as ShouldRe8_3_1_, applicatio3_.ShouldDumpMessage as ShouldDu9_3_1_, applicatio3_.UpdateDate as UpdateDate3_1_, applicatio3_.RedirectApplicationId as Redirec11_3_1_ FROM dbo.tblCore_NetworkDiverts this_ left outer join dbo.tblCore_Applications applicatio2_ on this_.ApplicationId=applicatio2_.ApplicationId left outer join dbo.tblCore_Applications applicatio3_ on applicatio2_.RedirectApplicationId=applicatio3_.ApplicationId WHERE this_.PhoneNetwork = @p0 and this_.IsEnabled = @p1
2010-09-09 18:53:54,031 DEBUG NHibernate.SQL - SELECT this_.PhoneNetwork as PhoneNet1_13_2_, this_.IsEnabled as IsEnabled13_2_, this_.UpdateDate as UpdateDate13_2_, this_.ApplicationId as Applicat4_13_2_, applicatio2_.ApplicationId as Applicat1_3_0_, applicatio2_.ApplicationName as Applicat2_3_0_, applicatio2_.ValidationKey as Validati3_3_0_, applicatio2_.ApplicationWebInterfaceUrl as Applicat4_3_0_, applicatio2_.IpAddress as IpAddress3_0_, applicatio2_.ApplicationWebInterfaceVersion as Applicat6_3_0_, applicatio2_.ShouldSend as ShouldSend3_0_, applicatio2_.ShouldRedirect as ShouldRe8_3_0_, applicatio2_.ShouldDumpMessage as ShouldDu9_3_0_, applicatio2_.UpdateDate as UpdateDate3_0_, applicatio2_.RedirectApplicationId as Redirec11_3_0_, applicatio3_.ApplicationId as Applicat1_3_1_, applicatio3_.ApplicationName as Applicat2_3_1_, applicatio3_.ValidationKey as Validati3_3_1_, applicatio3_.ApplicationWebInterfaceUrl as Applicat4_3_1_, applicatio3_.IpAddress as IpAddress3_1_, applicatio3_.ApplicationWebInterfaceVersion as Applicat6_3_1_, applicatio3_.ShouldSend as ShouldSend3_1_, applicatio3_.ShouldRedirect as ShouldRe8_3_1_, applicatio3_.ShouldDumpMessage as ShouldDu9_3_1_, applicatio3_.UpdateDate as UpdateDate3_1_, applicatio3_.RedirectApplicationId as Redirec11_3_1_ FROM dbo.tblCore_NetworkDiverts this_ left outer join dbo.tblCore_Applications applicatio2_ on this_.ApplicationId=applicatio2_.ApplicationId left outer join dbo.tblCore_Applications applicatio3_ on applicatio2_.RedirectApplicationId=applicatio3_.ApplicationId WHERE this_.PhoneNetwork = @p0 and this_.IsEnabled = @p1;@p0 = 0, @p1 = True
2010-09-09 18:53:54,031 DEBUG NHibernate.Connection.DriverConnectionProvider - Obtaining IDbConnection from Driver
2010-09-09 18:53:54,031 DEBUG NHibernate.AdoNet.AbstractBatcher - ExecuteReader took 0 ms
2010-09-09 18:53:54,031 DEBUG NHibernate.AdoNet.AbstractBatcher - Opened IDataReader, open IDataReaders: 1
2010-09-09 18:53:54,031 DEBUG NHibernate.Loader.Loader - processing result set
2010-09-09 18:53:54,031 DEBUG NHibernate.Loader.Loader - done processing result set (0 rows)
2010-09-09 18:53:54,031 DEBUG NHibernate.Driver.NHybridDataReader - running NHybridDataReader.Dispose()
2010-09-09 18:53:54,031 DEBUG NHibernate.AdoNet.AbstractBatcher - Closed IDataReader, open IDataReaders :0
2010-09-09 18:53:54,031 DEBUG NHibernate.AdoNet.AbstractBatcher - DataReader was closed after 1 ms
2010-09-09 18:53:54,031 DEBUG NHibernate.AdoNet.AbstractBatcher - Closed IDbCommand, open IDbCommands: 0
2010-09-09 18:53:54,031 DEBUG NHibernate.AdoNet.ConnectionManager - aggressively releasing database connection
2010-09-09 18:53:54,031 DEBUG NHibernate.Connection.ConnectionProvider - Closing connection
2010-09-09 18:53:54,031 DEBUG NHibernate.Loader.Loader - total objects hydrated: 0
2010-09-09 18:53:54,031 DEBUG NHibernate.Engine.StatefulPersistenceContext - initializing non-lazy collections
2010-09-09 18:53:54,031 DEBUG NHibernate.AdoNet.ConnectionManager - after autocommit
2010-09-09 18:53:54,031 DEBUG NHibernate.Impl.SessionImpl - transaction completion
2010-09-09 18:53:54,031 DEBUG NHibernate.AdoNet.ConnectionManager - aggressively releasing database connection
2010-09-09 18:53:54,031 DEBUG NHibernate.Impl.SessionImpl - [session-id=fce26533-bf6c-4f93-b75e-61a8c88c1e87] running ISession.Dispose()
2010-09-09 18:53:54,031 DEBUG NHibernate.Impl.SessionImpl - [session-id=fce26533-bf6c-4f93-b75e-61a8c88c1e87] executing real Dispose(True)
2010-09-09 18:53:54,031 DEBUG NHibernate.Impl.SessionImpl - closing session
2010-09-09 18:53:54,031 DEBUG NHibernate.AdoNet.AbstractBatcher - running BatcherImpl.Dispose(true)
2010-09-09 18:53:54,046 DEBUG xxx.Persist.NHibernateConnection - CreateSession(Commit)
2010-09-09 18:53:54,046 DEBUG NHibernate.Impl.SessionImpl - [session-id=d70b7e2f-062a-4495-83d0-380345acf920] opened session at timestamp: 634196552340, for session factory: [/0754517161044239b072f9d048fcb17f]
2010-09-09 18:53:54,046 DEBUG NHibernate.Transaction.AdoTransaction - Begin (Unspecified)
2010-09-09 18:53:54,046 DEBUG NHibernate.Connection.DriverConnectionProvider - Obtaining IDbConnection from Driver
2010-09-09 18:53:54,062 DEBUG NHibernate.Event.Default.DefaultSaveOrUpdateEventListener - updating detached instance
2010-09-09 18:53:54,078 DEBUG NHibernate.Event.Default.DefaultSaveOrUpdateEventListener - updating [xxx.Message.MoMessage#0]
2010-09-09 18:53:54,093 DEBUG NHibernate.Event.Default.AbstractFlushingEventListener - collection dereferenced while transient [xxx.Message.MoMessage.Segments#0]
2010-09-09 18:53:54,093 DEBUG NHibernate.Event.Default.DefaultSaveOrUpdateEventListener - updating [xxx.Message.MoMessage#0]
2010-09-09 18:53:54,109 DEBUG NHibernate.Transaction.AdoTransaction - Start Commit
2010-09-09 18:53:54,109 DEBUG NHibernate.Event.Default.AbstractFlushingEventListener - flushing session
2010-09-09 18:53:54,140 DEBUG NHibernate.Event.Default.AbstractFlushingEventListener - processing flush-time cascades
2010-09-09 18:53:54,140 DEBUG NHibernate.Event.Default.AbstractFlushingEventListener - dirty checking collections
2010-09-09 18:53:54,140 DEBUG NHibernate.Event.Default.AbstractFlushingEventListener - Flushing entities and processing referenced collections
2010-09-09 18:53:54,171 DEBUG NHibernate.Event.Default.WrapVisitor - Wrapped collection in role: xxx.Message.MoMessage.Segments
2010-09-09 18:53:54,171 DEBUG NHibernate.Event.Default.DefaultFlushEntityEventListener - Updating entity: [xxx.Message.MoMessage#0]
2010-09-09 18:53:54,187 DEBUG NHibernate.Engine.Collections - Collection found: [xxx.Message.MoMessage.Segments#0], was: [<unreferenced>] (initialized)
2010-09-09 18:53:54,187 DEBUG NHibernate.Event.Default.AbstractFlushingEventListener - Processing unreferenced collections
2010-09-09 18:53:54,187 DEBUG NHibernate.Event.Default.AbstractFlushingEventListener - Scheduling collection removes/(re)creates/updates
2010-09-09 18:53:54,187 DEBUG NHibernate.Event.Default.AbstractFlushingEventListener - Flushed: 0 insertions, 1 updates, 0 deletions to 1 objects
2010-09-09 18:53:54,187 DEBUG NHibernate.Event.Default.AbstractFlushingEventListener - Flushed: 1 (re)creations, 0 updates, 1 removals to 1 collections
2010-09-09 18:53:54,203 DEBUG NHibernate.Impl.Printer - listing entities:
2010-09-09 18:53:54,203 DEBUG NHibernate.Impl.Printer - xxx.Message.MoMessage{'MoMessageId'='0', 'MoMessageStatus'='52', 'PhoneNetwork'='0', 'MessageText'='Hi mum', 'ToNumber'='89000', 'FromNumber'='447000000000', 'IsCompleted'='True', 'UpdateDate'='09/09/2010 17:53:54', 'Aggregator'='xxx.AbstractAggregator#2', 'Application'='null', 'Segments'='['xxx.Message.MoSegment']'}
2010-09-09 18:53:54,203 DEBUG NHibernate.Event.Default.AbstractFlushingEventListener - executing flush
2010-09-09 18:53:54,203 DEBUG NHibernate.AdoNet.ConnectionManager - registering flush begin
2010-09-09 18:53:54,218 DEBUG NHibernate.Persister.Entity.AbstractEntityPersister - Updating entity: [xxx.Message.MoMessage#0]
2010-09-09 18:53:54,218 DEBUG NHibernate.AdoNet.AbstractBatcher - Opened new IDbCommand, open IDbCommands: 1
2010-09-09 18:53:54,218 DEBUG NHibernate.AdoNet.AbstractBatcher - Building an IDbCommand object for the SqlString: UPDATE dbo.tblCore_MoMessage SET MoMessageStatus = ?, PhoneNetwork = ?, MessageText = ?, ToNumber = ?, FromNumber = ?, IsCompleted = ?, UpdateDate = ?, AggregatorId = ?, ApplicationId = ? WHERE MoMessageId = ?
答案 0 :(得分:0)
问题似乎是在我当前的会话中打开另一个会话。第二个/内部会话只加载一些Aggregator和Application对象。不知道为什么这会导致我的问题所有我可以说不是打开另一个会话并加载其他对象已经解决了最初的问题。
看起来我将不得不使用外部会话来加载其他对象,但我现在还有其他事情要做。