-
I've inherited an ASP.NET MVC project that uses CSLA. Its storing a couple CSLA objects in session, I think this may be part of the problems its running into with hanging\thread locking, but I'm not sure how to explain and convince people that, this is the case so we can make the investment in...
-
Tasks run on a background thread from the thread pool. Because they are a different thread, thread-specific context (like the principal) doesn't automatically follow onto those threads. The Csla.Threading.BackgroundWorker automatically spins threads onto the thread pool with all the primary thread's...
-
I have just completed upgrading a business object from CSLA 1.1 to 4.1. I have converted the classes to use the new property declarations with managed backing fields, and added relevant business rules. There are 58 classes and I have encountered a strange problem in one of them. It is a grandchild and...
-
Please forgive the newbie questions, but I thought I had taken the safe and easy route... and now I have discovered my application locks up my server under heavy load. I have an ASP.NET (Wed Forms) application that uses CSLA and business objects generated by CodeSmith. Everything seems to work fine,...
-
I have not put any effort into supporting the use of background threads in ASP.NET. So I suppose there is no "expected behavior" really. However, you might try using Csla.Threading.BackgroundWorker to manage your background tasks. This type automatically copies the primary thread's identity...
-
Hi, I am trying to unit test our CRUD code for our CSLA project. I am using NUnit. I was hoping to use TransactionScope to clean up the database after each test. E.g. something like this.. [SetUp] public void SU() { _transactionScope = new TransactionScope(); } [TearDown] public void TD() { _transactionScope...
-
Async is complex. Most developers (including me) are unable to casually write async code and get it right. (btw, the "powers that be" is me - although some awesome contributions have been made by several people over the past few years, the feature set and design decisions in the framework are...
-
Andy is correct, CSLA .NET is not thread safe. There are numerous threads about this on the forum from over the years. It is also the case that the vast majority of .NET is not threadsafe. Very few parts of .NET are threadsafe, and they are documented in MSDN when they happen, because they are pretty...
-
[quote user="JonnyBee"] I have a reworked CslaBackroundWorker ready as per comments and dicussions I had with Rocky earlier. It is aimed at Rich clients as Rocky mentioned but I believe it should work fine in ASP.NET too - especially if you are already using the standard BackgroundWorker. My...
-
I've been doing a little digging around on this issue, and the issue is somewhat broader than what you are seeing. Not only does the current implementation complicate using background threads, but it causes issues in a mixed-mode app where you have both web UI elements and smart client elements ...
-
Well it is actually a little more complex than that if you get right down to it. I suspect what most people would actually expect to happen, is that some things (most notably GlobalContext and User) would automatically flow into the background thread. If all CSLA does is make sure there's a valid...
-
We are experimenting CSLA 4.0 RC0. In our web application (ASP.Net 4.0),on click of a button we create a Thread to do some lengthy calculations in the background . In the thread we found that all DataPortal operations are failing because GetPrincipal() is trying to retreive HttpContext.Current.User instead...
-
Yes "disabling all UI operations" is much easier said than done. Consider that really doing this would mean that the object would have to refuse to accept changes from the UI - not honoring property set, property get, IEditableObject, IDataErrorInfo, INotifyPropertyChanged, INotifyCollectionChanged...
-
Hi, A little bit of background first: 1. I am developing a WPF application that has many long running processes that need to be run on a background thread whilst at the same time providing feedback and a means of cancelling to the user. 2. I am using an MVC approach where the Model (a CSLA BO graph)...
-
Well, the short answer is that you can't have events flow through the dataportal like that. The long answer is, to get what you want, you'd need to record progress somewhere (likely in the database), and have a seperate background task which periodically fires another command object who's...
-
Andy is correct. static fields and properties are problematic, because they are shared across all threads in the appdomain (virtual root), and without locking or other techniques they are never safe. static methods that don't use global data (atomic, stateless methods) are safe because each method...
-
I think you have it backwards. Static methods are fine, so long as they don't modify the values of static fields / properties. If that's true, the method itself is thread safe. For instance objects, unless you build in thread safety, there is none. So two threads "using" the same instance...
-
Hi all I'm starting a new ASP.NET WebForms project. Using CSLA of course. Nearly all my CSLA work until now has been WinForms. I'd appreciate it if someone could confirm my understanding of basic thread safety. Sorry if this is a bit off topic. It's something I really should know well by...