Developer FAQ

 I have created a new thread, and is trying to get some data from DataConnection, and I'm getting the following exception:

System.InvalidOperationException: ThreadDataManager hasn't been initialized in the current thread
   at Composite.Verify.ThrowInvalidOperationException(String message)
   at Composite.Threading.ThreadDataManager.GetCurrentNotNull()
   .... 
What does it mean, and what should I do in order to fix it?

Answer:

There's a class, called Composite.Threading.ThreadDataManager, it is  responsible for managing internal resources, such as SQL connections. While executing code in a non-ASP.NET thread it is necessary to wrap calls to the data layer with the following construction:

using(Composite.Threading.ThreadingDataManager.EnsureInitialize())
{
   // ......
}