Can someone give me an example of how to set SelectBeforeUpdate and 
DynamicUpdate on a mapping of 2 or joined tables? I have a concurrency 
issue, where old data is overwriting recently changed data by another 
session.

For example tablea is joined to tableb in the mapping.  I open a form for a 
record and change a value in tablea.  Another user changes a value in 
tableb while I still have the form open. I save and the value in tableb 
reverts to the value I had.

Here is my code.  I tried adding the statements highlighted below, but it 
did not resolve the issue.

    public class JobMap : BaseJobMap<Job>

    {

        public JobMap()

        {

            Table("fcfgthd");

            /* LAL - 04/16/2013 - Added SelectBeforeUpdate and 
DynamicUpdate statements to prevent overwriting newly updated data*/

            SelectBeforeUpdate();

            DynamicUpdate();

            Id(o => o.Pkey, "fh_pkey");

            Join("fcairhd", a =>

                                {

                                    a.Optional();

                                    a.Fetch.Join();

                                    a.KeyColumn("hd_pkey");

                                    MapAirJobProperties(a);

                                });

             Join("fclegs", m =>

                               {

                                   m.Fetch.Join();

                                   m.KeyColumn("fl_pkey");

                                   MapJobLegProperties(m);

                               });

        }

     }

}

Thanks! 

-- 
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to fluent-nhibernate+unsubscr...@googlegroups.com.
To post to this group, send email to fluent-nhibernate@googlegroups.com.
Visit this group at http://groups.google.com/group/fluent-nhibernate?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to