CSLA 4 version 4.5.500 released

CSLA 4 version 4.5.500 released

Old forum URL: forums.lhotka.net/forums/t/12299.aspx


RockfordLhotka posted on Tuesday, January 07, 2014

CSLA 4 version 4.5.500 is released and is available via nuget or from www.cslanet.com

For more details read this blog post:

http://www.lhotka.net/weblog/CSLA4Version45500Released.aspx

skagen00 replied on Thursday, January 09, 2014

Introduced it into our solution, and am looking to see how our unit tests (12k) do against it.

Interestingly I found a couple read-only info lists that were failing to populate in Child_Fetch because IsReadOnly hadn't been turned off.  I don't understand why it was not failing before 4.5.500 and maybe there's something else going on.  I had to turn off and restore the IsReadOnly setting in a couple of my read-only lists (as I should have been doing).  I was on the other hand turning off RaiseListChangedEvents - so maybe in 4.1 that prevented the IsReadOnly check ... anyway, kind of interesting.

Less interestingly is that the tests that hit the database (about 25% of them are like that) are now having cases where some of them time out and fail to complete.  We structure these tests in a way such that we start a transaction that gets rolled back at the end of the test.   I'm not sure why it's happening, but I swapped back in the prior CSLA version (not too old, 4.5.10) and I didn't have any problems with the tests hanging.

If there is any insight as any changes in the way transactional behavior occurs within 4.5.500 that is different than 4.5.10 that would be really helpful...

 

skagen00 replied on Thursday, January 09, 2014

I should have probably just started a new thread for the prior post, but the problem for us involved this code, which worked prior to 4.5.500 - the logic is effectively something like this -

        /// <summary>
        /// Handles the customer save.
        /// </summary>
        /// <param name="forceUpdate">
        /// If <see langword="true"/>, triggers overriding IsNew and IsDirty.
        /// If <see langword="false"/> then it is the same as calling Save().
        /// </param>
        /// <param name="userState">User state data.</param>
        /// <param name="isSync">True if the save operation should be synchronous.</param>
        protected async override Task<Customer> SaveAsync(bool forceUpdate, object userState, bool isSync)
        {
            await RefreshRequestLockStatusAsync();

            // BusinessBase doesn't care about validity when deleting. It's important in this case.
            if (!IsValid && IsDeleted)
            {
                throw new Csla.Rules.ValidationException(Resources.NoSaveInvalidException);
            }

            return await base.SaveAsync(forceUpdate, userState, isSync);
        }

Basically, it provided a way to inject some "do some stuff before saving" after Save was no longer virtual.  In this case it checks to see if the record should be considered locked, which could have conceivably changed since the user got the record.

It happens that this is edge-case logic that I'm inclined to just drop rather than drill down to figure out what might have changed in this scenario. 

So basically just wanted to mention that while something has changed in some capacity, it was quite limited in scope and I'm planning on just adjusting my functionality because what's lost is pretty trivial stuff.  I'm not sure it'll affect others as when I run the test outside the scope of a transaction (i.e. not roll state back) it works...

 

ayubu replied on Monday, January 13, 2014

I am building the winrt 8.1 application using visual basic 2013 ultimate. a sample project attached.

I am building in a normal laptop with windows 8.1 installed.

I use the latest csla from nugget (this one you have posted) but I get an error for a trivial async create method with null reference expection with a stack race

 

 

   at Csla.Server.SimpleDataPortal.<Create>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at Csla.Server.DataPortalSelector.<Create>d__0.MoveNext()
   at Csla.DataPortal`1.HandleDataPortalException(String operation, DataPortalException ex, Boolean isSync, IDataPortalProxy proxy)
   at Csla.DataPortal`1.HandleCreateDataPortalException(DataPortalException ex, Boolean isSync, IDataPortalProxy proxy)
   at Csla.DataPortal`1.<DoCreateAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at Csla.DataPortal`1.<CreateAsync>d__c.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at Csla.DataPortal`1.<CreateAsync>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at Csla.DataPortal.<CreateAsync>d__0`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at App2.Entry.Form.VB$StateMachine_0_NewForm.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at App2.MainPage.VB$StateMachine_1_MainPage_Loaded.MoveNext()

ayubu replied on Monday, January 13, 2014

By referencing the project against the csla code I have established that that the Error comes from the DynamicMethodHandlerFactory class which is used by the DefaultDataPortalActivator to create instance of object in the create method of simpledataportal.

Just replaced it with the code

obj =

 

new LateBoundObject(System.Activator.CreateInstance(objectType));

from

obj =

 

new LateBoundObject(ApplicationContext.DataPortalActivator.CreateInstance(objectType));

at least it worked. ( now I am thinking to use the custom IDataPortalActivator)

May be there is a setting I am forgeting

On the other note in the supplied sample if I remove the child Property it works correctly

RockfordLhotka replied on Thursday, January 16, 2014

I've done some research on the null reference exception issue. There is an issue, but I believe it to be primarily cosmetic - in that the data portal is working as expected, but the outer exception (the BusinessException property in particular) is inaccurate. The InnerException graph is correct, at least in my replication of the issue.

https://github.com/MarimerLLC/csla/issues/249

As a result I'll work on solving the problem, but it is tricky to debug because the NullReference issue appears to be in the process of returning the exception to the client, not in the actual server-side data portal behavior itself.

Copyright (c) Marimer LLC