﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>Ayende Rahien commented on Rhino Service Bus &amp;amp; RavenDB integration</title><description>Jason,
I am using the no tracking policy.

I am registering it as transient, yes, although this is actually manage by the thread static.

The reason that I go directly through the module is mostly because it is already static</description><link>http://ayende.com/143361/rhino-service-bus-ravendb-integration#comment4</link><guid>http://ayende.com/143361/rhino-service-bus-ravendb-integration#comment4</guid><pubDate>Thu, 08 Dec 2011 08:51:08 GMT</pubDate></item><item><title>Jason Meckley commented on Rhino Service Bus &amp;amp; RavenDB integration</title><description>if you didn't use thread static then you would have a singleton of ISession, which was overwritten with each message consumed. thread static allows you to treat the singleton as a singleton per thread.

much the same way the session can be stored in Context.Items in a web environment.</description><link>http://ayende.com/143361/rhino-service-bus-ravendb-integration#comment3</link><guid>http://ayende.com/143361/rhino-service-bus-ravendb-integration#comment3</guid><pubDate>Wed, 07 Dec 2011 18:27:07 GMT</pubDate></item><item><title>Carlos Mendes commented on Rhino Service Bus &amp;amp; RavenDB integration</title><description>Ayende, why do we have to use the [ThreadStatic] attribute in the current session?</description><link>http://ayende.com/143361/rhino-service-bus-ravendb-integration#comment2</link><guid>http://ayende.com/143361/rhino-service-bus-ravendb-integration#comment2</guid><pubDate>Wed, 07 Dec 2011 15:55:15 GMT</pubDate></item><item><title>Jason Meckley commented on Rhino Service Bus &amp;amp; RavenDB integration</title><description>what about Windsor's component tracking and potential memory leaks? 

I thought that UsingFactoryMethod would mean Windsor would apply concerns to the components if necessary. In this case the DisposableDecommission concern. Since the session is never released from the container there would be a DisposableDecommission concern for each session. Thus a memory leak.

And wouldn't you want to register IDocumentSession as transient. Or is this covered by the threadstatic attribute within the module itself?

The only other thought I have is that resolving the current session directly from the module
() =&gt; RavenDbMessageModule.CurrentSession
and not the container 
kernel =&gt; kernel.Resolve[RavenDbMessageModule]().CurrentSession 
would mean Windsor would not apply the decommission concern.

</description><link>http://ayende.com/143361/rhino-service-bus-ravendb-integration#comment1</link><guid>http://ayende.com/143361/rhino-service-bus-ravendb-integration#comment1</guid><pubDate>Wed, 07 Dec 2011 13:18:19 GMT</pubDate></item></channel></rss>