views:

28

answers:

1

The official documentations says:

If ActiveRecord is running in a ASP.Net application, you must add this attribute with the value true

So naturally I turned it on and immediately noticed that those background threads (using Quartz.net) that use ActiveRecord to access the Database crash because they try to access HttpContext when there is no HttpContext.

Obviously the official "explanation" lacks in the explaining department! So considering the points I mentioned above, what is the isWeb for and why should I have it turned on?

+1  A: 

isWeb="true" is just shorthand for threadinfotype="Castle.ActiveRecord.Framework.Scopes.WebThreadScopeInfo, Castle.ActiveRecord"

WebThreadScopeInfo uses only HttpContext as sessionscope storage. If you have code that needs to use ActiveRecord outside of any HttpContext (e.g. Quartz.Net jobs), use the HybridWebThreadScopeInfo instead. When you define a specific threadscopeinfo class to use, there is no need to set isWeb.

Mauricio Scheffer