He,
I have any problem to update persitent object, occurs when sending gazette to my subscribers.
While sendings email, someone subscriber can read to gazette. In this time, my persitent object contain diferents values.
How refresh object without loader other time?
Hibernate version: 1.2
Mapping documents:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-cascade="save-update">
<class name="Cuyahoga.Modules.Newsletter.Domain.Campaign, Cuyahoga.Modules.Newsletter" table="cm_newsletter_campaign" lazy="true">
<id name="Id" column="campaignid" type="Int32" unsaved-value="0">
<generator class="native" />
</id>
<timestamp name="Updatetimestamp" column="updatetimestamp" unsaved-value="1/1/0001" />
<property name="Inserttimestamp" column="inserttimestamp" type="DateTime" />
<property name="Name" column="name" type="String" not-null="true" />
<property name="Description" column="description" type="String" not-null="true" />
<property name="Status" column="status" type="Int32" not-null="true" />
<property name="FromName" column="fromname" type="String" not-null="true" />
<property name="FromMail" column="frommail" type="String" not-null="true" />
<property name="Subject" column="subject" type="String" not-null="true" />
<property name="Body" column="body" type="String" not-null="true" />
<property name="Valid" column="valid" type="Boolean" not-null="true" />
<property name="GroupBelong" column="groupbelong" type="String" not-null="true" />
<property name="TotalMails" column="totalmails" type="Int32" not-null="true" />
<property name="SendMails" column="sendmails" type="Int32" not-null="true" />
<property name="ReadMails" column="readmails" type="Int32" not-null="true" />
<property name="Downs" column="downs" type="Int32" not-null="true" />
<property name="Ups" column="ups" type="Int32" not-null="true" />
<property name="Forwards" column="forwards" type="Int32" not-null="true" />
<many-to-one name="CreatedBy" class="Cuyahoga.Core.Domain.User, Cuyahoga.Core" column="createdby" />
<many-to-one name="ModifiedBy" class="Cuyahoga.Core.Domain.User, Cuyahoga.Core" column="modifiedby" cascade="save-update" />
<many-to-one name="Section" class="Cuyahoga.Core.Domain.Section, Cuyahoga.Core" column="sectionid"/>
<many-to-one name="Suscription" class="Cuyahoga.Modules.Newsletter.Domain.Suscription, Cuyahoga.Modules.Newsletter" column="suscriptionid"/>
<many-to-one name="Filter" class="Cuyahoga.Modules.Newsletter.Domain.Filter, Cuyahoga.Modules.Newsletter" column="filterid" />
<bag name="Queues" lazy="true" cascade="none">
<key column="campaignid" />
<one-to-many class="Cuyahoga.Modules.Newsletter.Domain.CampaignQueue, Cuyahoga.Modules.Newsletter" />
</bag>
</class>
</hibernate-mapping>
Full stack trace of any exception that occurs:Code:
{"Row was updated or deleted by another transaction (or unsaved-value
mapping was incorrect) for Cuyahoga.Modules.Newsletter.Domain.Campaign instance with identifier: 585"}
[NHibernate.StaleObjectStateException]: {"Row was updated or
deleted by another transaction (or unsaved-value mapping was
incorrect) for Cuyahoga.Modules.Newsletter.Domain.Campaign instance with identifier: 585"}
Data: {System.Collections.ListDictionaryInternal}
HelpLink: null
InnerException: null
Message: "Row was updated or deleted by another transaction (or
unsaved-value mapping was incorrect) for Cuyahoga.Modules.Newsletter.Domain.Campaign instance with
identifier: 585"
Source: "NHibernate"
StackTrace: " en
NHibernate.Persister.Entity.AbstractEntityPersister.Check(Int32 rows,
Object id, Int32 tableNumber, IExpectation expectation, IDbCommand
statement)\r\n en
NHibernate.Persister.Entity.AbstractEntityPersister.Update(Object id,
Object[] fields, Object[] oldFields, Boolean[] includeProperty, Int32
j, Object oldVersion, Object obj, SqlCommandInfo sql,
ISessionImplementor session)\r\n en
NHibernate.Persister.Entity.AbstractEntityPersister.Update(Object id,
Object[] fields, Int32[] dirtyFields, Boolean hasDirtyCollection,
Object[] oldFields, Object oldVersion, Object obj, ISessionImplementor
session)\r\n en NHibernate.Impl.ScheduledUpdate.Execute()\r\n en
NHibernate.Impl.SessionImpl.Execute(IExecutable executable)\r\n en
NHibernate.Impl.SessionImpl.ExecuteAll(IList list)\r\n en
NHibernate.Impl.SessionImpl.Execute()\r\n en
NHibernate.Impl.SessionImpl.Flush()\r\n en
Castle.Facilities.NHibernateIntegration.SessionDelegate.Flush()\r\n
en Cuyahoga.Modules.Newsletter.DataAccess.CampaignDao.SaveCampaign(Campaign campaign)\r\n en
ICampaignDaoProxy57f8a141904e41c080e30db4b0039abe.InvocationSaveCampaign_10.InvokeMethodOnTarget()
\r\n en Castle.DynamicProxy.AbstractInvocation.Proceed()\r\n en
Castle.Facilities.AutomaticTransactionManagement.TransactionInterceptor.Intercept(IInvocation
invocation)\r\n en Castle.DynamicProxy.AbstractInvocation.Proceed()\r
\n en
ICampaignDaoProxy57f8a141904e41c080e30db4b0039abe.SaveCampaign(Campaign
campaign)\r\n en SaveCampaign(Campaign campaign)\r\n en
Web.EditCampaign_send.DoWork(Object _context)"
TargetSite: {Void Check(Int32, System.Object, Int32,
NHibernate.AdoNet.IExpectation, System.Data.IDbCommand)}