I'm receiving the following error when I started using MessageQueue
inside a TransactionScope transaction - any ideas why this is
happening, I realise the transaction is now getting prompted to a
distributed transaction and hence have turned on and configured MSDTC.

I suspect this is something to do with row count, does anyone know?



Shown below is the MessageQueue that is causing NH to fail:

                using (var queue = new MessageQueue(_exportEndpoint))
                {
                    var label = string.Format("{0} ComponentId - {1}",
DateTime.Now.ToUniversalTime(), componentId);
                    queue.Send(contents, label,
MessageQueueTransactionType.Automatic);
                    _log.WriteInfo("ExportToQueue: Message sent to
queue - " + label);
                }

Shown below is the exception from NH:

2010-08-20 15:27:22,516 [6] ERROR
NHibernate.Event.Default.AbstractFlushingEventListener - Could not
synchronize database state with session
NHibernate.StaleStateException: Unexpected row count: -1; expected: 1
   at
NHibernate.AdoNet.Expectations.BasicExpectation.VerifyOutcomeNonBatched(Int32
rowCount, IDbCommand statement)
   at NHibernate.AdoNet.NonBatchingBatcher.AddToBatch(IExpectation
expectation)
   at
NHibernate.Persister.Entity.AbstractEntityPersister.Update(Object id,
Object[] fields, Object[] oldFields, Object rowId, Boolean[]
includeProperty, Int32 j, Object oldVersion, Object obj,
SqlCommandInfo sql, ISessionImplementor session)
   at
NHibernate.Persister.Entity.AbstractEntityPersister.UpdateOrInsert(Object
id, Object[] fields, Object[] oldFields, Object rowId, 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, Object rowId,
ISessionImplementor session)
   at NHibernate.Action.EntityUpdateAction.Execute()
   at NHibernate.Engine.ActionQueue.Execute(IExecutable executable)
   at NHibernate.Engine.ActionQueue.ExecuteActions(IList list)
   at NHibernate.Engine.ActionQueue.ExecuteActions()
   at
NHibernate.Event.Default.AbstractFlushingEventListener.PerformExecutions(IEventSource
session)

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to