Hi, I'm not familiar with using then join mapping but this MUST be a bug. Missing data is something completely different than wrong data. Maybe it's not easy to be found out there. If I find some time, I try to reproduce the problem but don't expect much of that. I'm not deep enough in that matter to provide credible feedback.
Did you try using a version column in your Case table? Would it be an option for you to do such minor schema changes? Maybe the system would behave the way you expect it to do if it could decide about stale data already in the leading table of your join mapping. On 30 Jun., 23:35, Mike <[email protected]> wrote: > I have a legacy table, Case, which I am extending via a <join> (see > abridged mapping below) in a new application. I want to use > optimistic locking so that if another user changes the joined CaseEx > table, I get a StaleObjectStateException. Updates of stale data do > cause a StaleStateException to be thrown, but it is caught and > discarded because IsNullableTable is true in the following code from > AbstractEntityPersister. Is this a bug or am I trying to do > something > which is not supported? > > protected bool Check(int rows, object id, int > tableNumber, > IExpectation expectation, IDbCommand statement) > { > try > { > > expectation.VerifyOutcomeNonBatched(rows, statement); > } > catch (StaleStateException) > { > if (!IsNullableTable(tableNumber)) > { > if > (Factory.Statistics.IsStatisticsEnabled) > > Factory.StatisticsImplementor.OptimisticFailure(EntityName); > > throw new > StaleObjectStateException(EntityName, id); > } > } > catch (TooManyRowsAffectedException ex) > { > throw new > HibernateException("Duplicate identifier in table for: " > + MessageHelper.InfoString(this, id, Factory), ex); > } > catch (Exception) > { > return false; > } > return true; > } > > <class name="Case" schema="Cases" table="`Case`" optimistic- > lock="dirty" dynamic-update="true"> > > <id name="CaseId" > > <generator class="identity"/> > </id> > <property name="CaseCode"/> > <property name="MarketingCaseCode"/> > <property name="Name" column="CaseName"/> > <property name="Status" column="StatusId"/> > > <join schema="CSA" table="CaseEx" optional="true"> > <key column="CaseId"/> > > <property name="Details"/> > <property name="Template"/> > </join> > </class> -- 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.
