<?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: Virtual member call in constructor and NHibernate</title>
	<atom:link href="http://www.tigraine.at/2008/11/07/virtual-member-call-in-constructor-and-nhibernate/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tigraine.at/2008/11/07/virtual-member-call-in-constructor-and-nhibernate/</link>
	<description>Daniel Hoelbling talks about .NET</description>
	<lastBuildDate>Sun, 14 Mar 2010 16:22:22 +0100</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Tigraine</title>
		<link>http://www.tigraine.at/2008/11/07/virtual-member-call-in-constructor-and-nhibernate/comment-page-1/#comment-1350</link>
		<dc:creator>Tigraine</dc:creator>
		<pubDate>Fri, 07 Nov 2008 23:05:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.tigraine.at/2008/11/07/virtual-member-call-in-constructor-and-nhibernate/#comment-1350</guid>
		<description>public virtual ISet&lt;OrderItem&gt; OrderItems&lt;br&gt;        {&lt;br&gt;            get { return orderItems_; }&lt;br&gt;            set { orderItems_ = value; }&lt;br&gt;        }&lt;br&gt;&lt;br&gt;        private ISet&lt;OrderItem&gt; orderItems_;&lt;br&gt;&lt;br&gt;        public Order()&lt;br&gt;        {&lt;br&gt;            orderItems_ = new HashedSet&lt;OrderItem&gt;();&lt;br&gt;        }&lt;br&gt;&lt;br&gt;I know it should work that way, but it doesn&#039;t.&lt;br&gt;Can&#039;t say why. But it doesn&#039;t work. &lt;br&gt;&lt;br&gt;Maybe I should have added that the problem is occuring during my Repository unit tests. If I run the tests one by one it works, but if they get executed all together I get the exception.&lt;br&gt;&lt;br&gt;I think I&#039;ll dedicate some more time to the problem tomorrow. But debugging concurrency issues sucks.</description>
		<content:encoded><![CDATA[<p>public virtual ISet&lt;OrderItem&gt; OrderItems<br />        {<br />            get { return orderItems_; }<br />            set { orderItems_ = value; }<br />        }</p>
<p>        private ISet&lt;OrderItem&gt; orderItems_;</p>
<p>        public Order()<br />        {<br />            orderItems_ = new HashedSet&lt;OrderItem&gt;();<br />        }</p>
<p>I know it should work that way, but it doesn&#39;t.<br />Can&#39;t say why. But it doesn&#39;t work. </p>
<p>Maybe I should have added that the problem is occuring during my Repository unit tests. If I run the tests one by one it works, but if they get executed all together I get the exception.</p>
<p>I think I&#39;ll dedicate some more time to the problem tomorrow. But debugging concurrency issues sucks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ayende Rahien</title>
		<link>http://www.tigraine.at/2008/11/07/virtual-member-call-in-constructor-and-nhibernate/comment-page-1/#comment-1349</link>
		<dc:creator>Ayende Rahien</dc:creator>
		<pubDate>Fri, 07 Nov 2008 22:55:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.tigraine.at/2008/11/07/virtual-member-call-in-constructor-and-nhibernate/#comment-1349</guid>
		<description>You set the field in the ctor, not touching the property, and that will work</description>
		<content:encoded><![CDATA[<p>You set the field in the ctor, not touching the property, and that will work</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tigraine</title>
		<link>http://www.tigraine.at/2008/11/07/virtual-member-call-in-constructor-and-nhibernate/comment-page-1/#comment-1348</link>
		<dc:creator>Tigraine</dc:creator>
		<pubDate>Fri, 07 Nov 2008 20:28:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.tigraine.at/2008/11/07/virtual-member-call-in-constructor-and-nhibernate/#comment-1348</guid>
		<description>That didn&#039;t work.. I tried having a private field that gets accessed through the property and that gets set by the ctor..&lt;br&gt;I also tried to set the field on demand from the property, but both times I got the &quot;Illegal attempt to associate a collection with two open sessions&quot;.&lt;br&gt;&lt;br&gt;Thanks anyway, I guess initializing the collection isn&#039;t all that difficult after all :)</description>
		<content:encoded><![CDATA[<p>That didn&#39;t work.. I tried having a private field that gets accessed through the property and that gets set by the ctor..<br />I also tried to set the field on demand from the property, but both times I got the &#8220;Illegal attempt to associate a collection with two open sessions&#8221;.</p>
<p>Thanks anyway, I guess initializing the collection isn&#39;t all that difficult after all <img src='http://www.tigraine.at/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ayende Rahien</title>
		<link>http://www.tigraine.at/2008/11/07/virtual-member-call-in-constructor-and-nhibernate/comment-page-1/#comment-1347</link>
		<dc:creator>Ayende Rahien</dc:creator>
		<pubDate>Fri, 07 Nov 2008 19:33:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.tigraine.at/2008/11/07/virtual-member-call-in-constructor-and-nhibernate/#comment-1347</guid>
		<description>The solution to this is init the collection via the property, but to initialize the field.</description>
		<content:encoded><![CDATA[<p>The solution to this is init the collection via the property, but to initialize the field.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
