[Test]
        public void DsTest()
        {
            var state = new DisconnectedState() { MergeMode = MergeMode.PreferTarget }; //MergeMode.PreferSource makes no sense
            List<User> users = null;
            List<FilterEntity> suppliers = null;

            using (var session = Session.Open(domain))
            {
                using (state.Attach(session))
                {
                    using (var transactionScope = Transaction.Open())
                    {
                        using (state.Connect())
                        {
                            var doc = Query.All<FilterEntity>().Where(f => f.Integer == 1).Prefetch(s => s.ItemGroup).Single();

                            var subs = doc.ItemGroup.Where(g => true).ToList();

                            foreach (var sub in subs)
                            {
                                sub.Name = "1111";
                            }

                            doc.ItemGroup.Add(new AnotherEntity(new Guid("0A92624B-191F-465B-B57A-EEB05C56EFC0")));
                            doc.ItemGroup.Add(new AnotherEntity(new Guid("7324BEB0-7E44-4901-8AF2-88203CC247EC")));
                            doc.ItemGroup.Add(new AnotherEntity(new Guid("2CA9839C-6E29-47B9-9B52-80026C64F2B6")));
                        }

                        transactionScope.Complete();
                    }
                }
            }

            using (var session = Session.Open(domain))
            {
                using (state.Attach(session))
                {
                    using (var transactionScope = Transaction.Open())
                    {
                        using (state.Connect())
                        {
                            var doc = Query.All<FilterEntity>().Where(f => f.Integer == 1).Prefetch(s => s.ItemGroup).Single();

                            var subs = doc.ItemGroup.Where(g => true).ToList();

                            foreach (var sub in subs)
                            {
                                sub.Name = "22222";
                            }
                        }

                        transactionScope.Complete();
                    }

                    state.ApplyChanges();
                }
            }
        }

After executing this code, i have 4 items with Name = 2222 and 3 with null Names in the database. Obviously these 3 are the ones added inside the DisconnectedState. I expected all of the items to be changed. I tried both MergeMode.PreferTarget and MergeMode.PreferSource modes, the result is identical.


Updated at 02.04.2010 13:28:14

I've send you code for this and other bugs. PoC for this bug is located in > public void DsTest() in MembershipTests


Updated at 12.04.2010 5:56:45

Any status updates?

This thread was imported from our support forum. The original discussion may contain more detailed answer.

asked Apr 02 '10 at 13:16

xumix's gravatar image

xumix
425757682


One Answer:

Nothing is done yet. The cause: we should temporarily switch most of DO4 team to other projects on previous week - there was a huge demand of people there. So we were able to work only on migration to VS2010 / PostSharp 2.0 (+ me @ ASP.NET MVC integration & samples).

We're going to close all the issues on this week.

As far as I remember, this is the first time during last year year when we've been using this "opportinity" to push forward another project we run, so should be a rare case.


Err... Forgot to add: most of errors related to this issue were in test code. But it identified few problems in DO4 as well.

See the following commit messages for details:

answered Apr 12 '10 at 07:20

Alex%20Yakunin's gravatar image

Alex Yakunin
29714412

Fixed. But after today's modifications about 40 new tests fail (likely, something wrong in LINQ translator), so please wait with updates for tomorrow.

(Apr 12 '10 at 07:20) Alex Yakunin Alex%20Yakunin's gravatar image
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

Subscription:

Once you sign in you will be able to subscribe for any updates here

Tags:

×574

Asked: Apr 02 '10 at 13:16

Seen: 3,253 times

Last updated: Apr 02 '10 at 13:16

powered by OSQA