Guys, it is no way normal if you release 4.3.1 nightly with breaking changes(I mean SessionEventAccessor ofc). Name it 4.4 or somewhat like that. Plz, create a branch for fix-only versions. Moreover, now, when there is no source, I cannot get, how to use that new class. Btw, I'm getting this:

Test(s) failed. System.NullReferenceException : Object reference not set to an instance of an object.
   at Werp.Model.Models.CachingModule.<OnBuilt>b__0(Object source, SessionEventArgs args) in d:\BuildAgents\2\work\e48b9b88332e071b\trunk\Werp.Model.Models\CachingModule.cs:line 81
   at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
   at Xtensive.Storage.Domain.OpenSession(SessionConfiguration configuration, Boolean activate)
   at Werp.Controller.Tests.Templates.DomainBoundTest.BeforeTestMethod() in d:\BuildAgents\2\work\e48b9b88332e071b\trunk\Werp.Controller.Tests\Templates\DomainBoundTest.cs:line 48

with this:

    /// <summary>
    /// Модуль для поддержки иерархий
    /// </summary>
    public sealed class HierarchyRebuildModule : IModule
    {
        [ServiceConstructor]
        public HierarchyRebuildModule()
        {
        }

        /// <summary>Called when the build of <see cref="T:Xtensive.Storage.Building.Definitions.DomainModelDef"/> is completed.</summary>
        /// <param name="context">The domain building context.</param>
        /// <param name="model">The domain model definition.</param>
        public void OnDefinitionsBuilt(BuildingContext context, DomainModelDef model)
        {
        }

        /// <summary>Called when 'complex' build process is completed.</summary>
        /// <param name="domain">The built domain.</param>
        public void OnBuilt(Domain domain)
        {
            domain.SessionOpen += (source, args) =>
                                  {
                                      var accessor = args.Session.Services.Get<SessionEventAccessor>();
                                      accessor.TransactionOpened += TransactionOpened; // <<<<<<<<<<<<<====================== line 81
                                      accessor.TransactionCommitting += TransactionCommitting;
                                      accessor.EntityChanging += EntityEvent;
                                      accessor.EntityCreated += EntityEvent;
                                      accessor.EntityRemove += EntityEvent;
                                  };
        }

Updated at 16.08.2010 12:07:49

Ok, thx for the fix. Concerning branching: well, then it would be nice to have latest stable nightly + latest dev nightly builds. So one could use eigther new features or only fixes. For eg. we dont really need new features, but will be very happy with bugfixes :)

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

asked Aug 16 '10 at 06:31

xumix's gravatar image

xumix
425757682

edited Sep 03 '10 at 16:26

Alex%20Yakunin's gravatar image

Alex Yakunin
29714412


One Answer:

Hmm... There is no SessionEventAccessor for pretty long time - that's why you get NullReferenceException on attempt to get it. Btw, it's better to use Session.Services.Demand<t>() - Demand is extension method wrapping Get, so it would throw an exception immediately in this case.

Concerning the fix: you should use Session.Events member instead.

Concerning branching: we use it; latest nightly build is intentionally produced from development branch - it passes the same amount of tests as stable version.

answered Aug 16 '10 at 09:23

Alex%20Yakunin's gravatar image

Alex Yakunin
29714412

That will be done shortly. Actually, current situation isn't as good as you want only because we also maintain v4.2 branch - likely, we'll stop paying so much attention to this in few weeks, and this will significantly simplify everything.

(Aug 16 '10 at 09:23) Alex Yakunin Alex%20Yakunin's gravatar image

ok, thanks a lot:)

(Aug 16 '10 at 09:23) xumix xumix'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

powered by OSQA