<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Integrating StructureMap and NHibernate with WCF</title>
	<atom:link href="http://lostechies.com/jimmybogard/2008/09/16/integrating-structuremap-and-nhibernate-with-wcf/feed/" rel="self" type="application/rss+xml" />
	<link>http://lostechies.com/jimmybogard/2008/09/16/integrating-structuremap-and-nhibernate-with-wcf/</link>
	<description>Strong opinions, weakly held</description>
	<lastBuildDate>Wed, 22 May 2013 13:39:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
	<item>
		<title>By: Anonymous</title>
		<link>http://lostechies.com/jimmybogard/2008/09/16/integrating-structuremap-and-nhibernate-with-wcf/#comment-4030</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Thu, 20 Oct 2011 00:53:00 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/09/16/integrating-structuremap-and-nhibernate-with-wcf.aspx#comment-4030</guid>
		<description>So unfortunately I wrote this post many years ago and the code is all lost. Sorry! You can try the StructureMap mailing list, however.</description>
		<content:encoded><![CDATA[<p>So unfortunately I wrote this post many years ago and the code is all lost. Sorry! You can try the StructureMap mailing list, however.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pavan Kumar Puttaparthi Tiruma</title>
		<link>http://lostechies.com/jimmybogard/2008/09/16/integrating-structuremap-and-nhibernate-with-wcf/#comment-4027</link>
		<dc:creator>Pavan Kumar Puttaparthi Tiruma</dc:creator>
		<pubDate>Wed, 19 Oct 2011 04:56:00 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/09/16/integrating-structuremap-and-nhibernate-with-wcf.aspx#comment-4027</guid>
		<description>Thanks for this article. Is it possible for you to upload the solution as well?
To tell truth I’m a newbie to StructureMap and I would like to use for a scenario where there are multiple Service projects with each project potentially having multiple service contract implementation (such as PingService, CustomerService, AssetService, CalculationService) and finally a Web application that has all the service files (i.e. multiple .svc files)
I want to use StructureMap on WCF so that but have it all registered in one place (i.e. inside web application) and I don’t know how it works.
Thanks for your help </description>
		<content:encoded><![CDATA[<p>Thanks for this article. Is it possible for you to upload the solution as well?<br />
To tell truth I’m a newbie to StructureMap and I would like to use for a scenario where there are multiple Service projects with each project potentially having multiple service contract implementation (such as PingService, CustomerService, AssetService, CalculationService) and finally a Web application that has all the service files (i.e. multiple .svc files)<br />
I want to use StructureMap on WCF so that but have it all registered in one place (i.e. inside web application) and I don’t know how it works.<br />
Thanks for your help </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sean Biefeld</title>
		<link>http://lostechies.com/jimmybogard/2008/09/16/integrating-structuremap-and-nhibernate-with-wcf/#comment-886</link>
		<dc:creator>Sean Biefeld</dc:creator>
		<pubDate>Tue, 26 Jan 2010 05:57:38 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/09/16/integrating-structuremap-and-nhibernate-with-wcf.aspx#comment-886</guid>
		<description>Uber-useful! Mad props to you sir. Thanks much!</description>
		<content:encoded><![CDATA[<p>Uber-useful! Mad props to you sir. Thanks much!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jimmy Bogard</title>
		<link>http://lostechies.com/jimmybogard/2008/09/16/integrating-structuremap-and-nhibernate-with-wcf/#comment-885</link>
		<dc:creator>Jimmy Bogard</dc:creator>
		<pubDate>Tue, 14 Oct 2008 02:37:52 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/09/16/integrating-structuremap-and-nhibernate-with-wcf.aspx#comment-885</guid>
		<description>@Neil

Yep, the contextual session seems to be the way to go.  Let me know how it goes!</description>
		<content:encoded><![CDATA[<p>@Neil</p>
<p>Yep, the contextual session seems to be the way to go.  Let me know how it goes!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Neil Mosafi</title>
		<link>http://lostechies.com/jimmybogard/2008/09/16/integrating-structuremap-and-nhibernate-with-wcf/#comment-884</link>
		<dc:creator>Neil Mosafi</dc:creator>
		<pubDate>Mon, 13 Oct 2008 20:01:32 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/09/16/integrating-structuremap-and-nhibernate-with-wcf.aspx#comment-884</guid>
		<description>Hey Jimmy... referring back to my comment from last month - I spiked implementing this and I was completely dumb in thinking I could depend directly on the ISession interface in my repository!  The reason is that repositories are usually configured as singletons - therefore even if the session is per-call you&#039;re still gonna get the same instance for your repositories and everything will come crashing to a halt!

Anyway I actually think Frank&#039;s suggestion is best - defining a context for NHibernate&#039;s GetCurrentSession() method and delegating that to an IExtension in WCF. That is what I am going to propose to the rest of my team anyway!

Cheers
Neil</description>
		<content:encoded><![CDATA[<p>Hey Jimmy&#8230; referring back to my comment from last month &#8211; I spiked implementing this and I was completely dumb in thinking I could depend directly on the ISession interface in my repository!  The reason is that repositories are usually configured as singletons &#8211; therefore even if the session is per-call you&#8217;re still gonna get the same instance for your repositories and everything will come crashing to a halt!</p>
<p>Anyway I actually think Frank&#8217;s suggestion is best &#8211; defining a context for NHibernate&#8217;s GetCurrentSession() method and delegating that to an IExtension in WCF. That is what I am going to propose to the rest of my team anyway!</p>
<p>Cheers<br />
Neil</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frank Quednau</title>
		<link>http://lostechies.com/jimmybogard/2008/09/16/integrating-structuremap-and-nhibernate-with-wcf/#comment-883</link>
		<dc:creator>Frank Quednau</dc:creator>
		<pubDate>Tue, 23 Sep 2008 07:44:57 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/09/16/integrating-structuremap-and-nhibernate-with-wcf.aspx#comment-883</guid>
		<description>Hi there,
I thought I add some more spice to this by pointing to my post today - (http://realfiction.net/?q=node/167)
I thought we should have honorable mentions of NH&#039;s possibility to define a class that provides a &quot;Current Session&quot; (which you get via sessionFactory.GetCurrentSession()) as well as making use of the WCF InstanceContext. Cheers!</description>
		<content:encoded><![CDATA[<p>Hi there,<br />
I thought I add some more spice to this by pointing to my post today &#8211; (<a href="http://realfiction.net/?q=node/167" rel="nofollow">http://realfiction.net/?q=node/167</a>)<br />
I thought we should have honorable mentions of NH&#8217;s possibility to define a class that provides a &#8220;Current Session&#8221; (which you get via sessionFactory.GetCurrentSession()) as well as making use of the WCF InstanceContext. Cheers!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jimmy Bogard</title>
		<link>http://lostechies.com/jimmybogard/2008/09/16/integrating-structuremap-and-nhibernate-with-wcf/#comment-882</link>
		<dc:creator>Jimmy Bogard</dc:creator>
		<pubDate>Fri, 19 Sep 2008 00:05:02 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/09/16/integrating-structuremap-and-nhibernate-with-wcf.aspx#comment-882</guid>
		<description>@Neil

I dunno, I&#039;ve never really tried going through a container.  Since it always has to be built from an ISessionFactory, it just made more sense to me to wrap it all up.  Have you been able to get it in through the container?</description>
		<content:encoded><![CDATA[<p>@Neil</p>
<p>I dunno, I&#8217;ve never really tried going through a container.  Since it always has to be built from an ISessionFactory, it just made more sense to me to wrap it all up.  Have you been able to get it in through the container?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jimmy Bogard</title>
		<link>http://lostechies.com/jimmybogard/2008/09/16/integrating-structuremap-and-nhibernate-with-wcf/#comment-881</link>
		<dc:creator>Jimmy Bogard</dc:creator>
		<pubDate>Fri, 19 Sep 2008 00:03:04 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/09/16/integrating-structuremap-and-nhibernate-with-wcf.aspx#comment-881</guid>
		<description>@Paul, @Mike

The other problem I&#039;m running into is that I have a hard time testing anything multi-threaded with any consistency.  Unless I can write a good test for it, I just have a tough time convincing myself it works.</description>
		<content:encoded><![CDATA[<p>@Paul, @Mike</p>
<p>The other problem I&#8217;m running into is that I have a hard time testing anything multi-threaded with any consistency.  Unless I can write a good test for it, I just have a tough time convincing myself it works.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Neil Mosafi</title>
		<link>http://lostechies.com/jimmybogard/2008/09/16/integrating-structuremap-and-nhibernate-with-wcf/#comment-880</link>
		<dc:creator>Neil Mosafi</dc:creator>
		<pubDate>Thu, 18 Sep 2008 15:52:02 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/09/16/integrating-structuremap-and-nhibernate-with-wcf.aspx#comment-880</guid>
		<description>Hi, can you explain why you need the ISessionBuilder in first place.  Why can&#039;t you make the ISession a direct dependency of the repository, and then get your container to pass a shared instance to all your repositories.  So your constructor would simply be

public ProductRepository(ISession session) { _session = session; }</description>
		<content:encoded><![CDATA[<p>Hi, can you explain why you need the ISessionBuilder in first place.  Why can&#8217;t you make the ISession a direct dependency of the repository, and then get your container to pass a shared instance to all your repositories.  So your constructor would simply be</p>
<p>public ProductRepository(ISession session) { _session = session; }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Batum</title>
		<link>http://lostechies.com/jimmybogard/2008/09/16/integrating-structuremap-and-nhibernate-with-wcf/#comment-879</link>
		<dc:creator>Paul Batum</dc:creator>
		<pubDate>Wed, 17 Sep 2008 20:47:42 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/09/16/integrating-structuremap-and-nhibernate-with-wcf.aspx#comment-879</guid>
		<description>Yeah a double check lock will definitely do the trick. The ye olde enterprise nhibernate sample on codeplex does it an interesting way using a nested type. But I agree that as soon as you do it on type initalization the exceptions are more of a pain to work with.</description>
		<content:encoded><![CDATA[<p>Yeah a double check lock will definitely do the trick. The ye olde enterprise nhibernate sample on codeplex does it an interesting way using a nested type. But I agree that as soon as you do it on type initalization the exceptions are more of a pain to work with.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
