<?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: Part 8: DAOs, Repositories, or Query Objects</title>
	<atom:link href="http://jasondentler.com/blog/2009/09/part-8-daos-repositories-or-query-objects/feed/" rel="self" type="application/rss+xml" />
	<link>http://jasondentler.com/blog/2009/09/part-8-daos-repositories-or-query-objects/</link>
	<description>I&#039;m just here for the code</description>
	<lastBuildDate>Mon, 06 Sep 2010 12:21:16 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Simon</title>
		<link>http://jasondentler.com/blog/2009/09/part-8-daos-repositories-or-query-objects/comment-page-1/#comment-676</link>
		<dc:creator>Simon</dc:creator>
		<pubDate>Wed, 09 Sep 2009 09:48:10 +0000</pubDate>
		<guid isPermaLink="false">http://jasondentler.com/blog/?p=402#comment-676</guid>
		<description>I&#039;m not using exactly the same code as you, but for me when I check the session for a transaction it is never null. However the IsActive property on the transaction is set to false if it hasn&#039;t been started.

Is this a bug or do you see a difference behaviour due to the different ways we have NHibernate setup?</description>
		<content:encoded><![CDATA[<p>I&#8217;m not using exactly the same code as you, but for me when I check the session for a transaction it is never null. However the IsActive property on the transaction is set to false if it hasn&#8217;t been started.</p>
<p>Is this a bug or do you see a difference behaviour due to the different ways we have NHibernate setup?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Noam Gal</title>
		<link>http://jasondentler.com/blog/2009/09/part-8-daos-repositories-or-query-objects/comment-page-1/#comment-672</link>
		<dc:creator>Noam Gal</dc:creator>
		<pubDate>Wed, 09 Sep 2009 06:52:15 +0000</pubDate>
		<guid isPermaLink="false">http://jasondentler.com/blog/?p=402#comment-672</guid>
		<description>I must say I still don&#039;t get it - sorry.
Isn&#039;t an implicit transaction just the same old &quot;BeginTransaction&quot; call being made by NHibernate code inside? Won&#039;t this transaction commit affect the 2nd level cache just like any other (explicit) transaction commit?

What would be the easiest way to test this? Is there some way to see what objects are inside the 2nd level cache at a given time? I might try a spike on the weekend.</description>
		<content:encoded><![CDATA[<p>I must say I still don&#8217;t get it &#8211; sorry.<br />
Isn&#8217;t an implicit transaction just the same old &#8220;BeginTransaction&#8221; call being made by NHibernate code inside? Won&#8217;t this transaction commit affect the 2nd level cache just like any other (explicit) transaction commit?</p>
<p>What would be the easiest way to test this? Is there some way to see what objects are inside the 2nd level cache at a given time? I might try a spike on the weekend.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason</title>
		<link>http://jasondentler.com/blog/2009/09/part-8-daos-repositories-or-query-objects/comment-page-1/#comment-666</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Tue, 08 Sep 2009 15:56:57 +0000</pubDate>
		<guid isPermaLink="false">http://jasondentler.com/blog/?p=402#comment-666</guid>
		<description>Noam - Yes. As I understand it, in these single-operation DB interactions, the explicit transactions are used purely for the benefit of the 2nd level cache. 

The incorrect example uses an implicit transaction, and therefore doesn&#039;t affect the 2nd level cache. When or whether the implicit transaction is committed or rolled back is irrelevant from the viewpoint of the 2nd level cache.</description>
		<content:encoded><![CDATA[<p>Noam &#8211; Yes. As I understand it, in these single-operation DB interactions, the explicit transactions are used purely for the benefit of the 2nd level cache. </p>
<p>The incorrect example uses an implicit transaction, and therefore doesn&#8217;t affect the 2nd level cache. When or whether the implicit transaction is committed or rolled back is irrelevant from the viewpoint of the 2nd level cache.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Noam Gal</title>
		<link>http://jasondentler.com/blog/2009/09/part-8-daos-repositories-or-query-objects/comment-page-1/#comment-664</link>
		<dc:creator>Noam Gal</dc:creator>
		<pubDate>Tue, 08 Sep 2009 14:41:02 +0000</pubDate>
		<guid isPermaLink="false">http://jasondentler.com/blog/?p=402#comment-664</guid>
		<description>I am not sure I understand the 2nd level cache example given at the end of the article, as this seems like the only good reason to explicitly open the transaction ourselves in such cases -
on the *wrong* example with no transaction it has

using(var session = sessionFactory.OpenSession()) 
{ 
	var post = session.Get(1);
	// do something with post
} 

and the article says that since there is no commit on the (implicit) transaction, the post will not get into the 2nd level cache. Doesn&#039;t hibernate commit the implicit transaction on session close? Won&#039;t it be committed after the closing brackets?</description>
		<content:encoded><![CDATA[<p>I am not sure I understand the 2nd level cache example given at the end of the article, as this seems like the only good reason to explicitly open the transaction ourselves in such cases -<br />
on the *wrong* example with no transaction it has</p>
<p>using(var session = sessionFactory.OpenSession())<br />
{<br />
	var post = session.Get(1);<br />
	// do something with post<br />
} </p>
<p>and the article says that since there is no commit on the (implicit) transaction, the post will not get into the 2nd level cache. Doesn&#8217;t hibernate commit the implicit transaction on session close? Won&#8217;t it be committed after the closing brackets?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason</title>
		<link>http://jasondentler.com/blog/2009/09/part-8-daos-repositories-or-query-objects/comment-page-1/#comment-660</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Tue, 08 Sep 2009 10:57:15 +0000</pubDate>
		<guid isPermaLink="false">http://jasondentler.com/blog/?p=402#comment-660</guid>
		<description>@Noam - This is a common mistake, and one I&#039;ve certainly made myself. The reason for doing it this way is explained in the section &quot;Transactions and the second level cache&quot; here:
http://nhprof.com/Learn/Alert?name=DoNotUseImplicitTransactions</description>
		<content:encoded><![CDATA[<p>@Noam &#8211; This is a common mistake, and one I&#8217;ve certainly made myself. The reason for doing it this way is explained in the section &#8220;Transactions and the second level cache&#8221; here:<br />
<a href="http://nhprof.com/Learn/Alert?name=DoNotUseImplicitTransactions" rel="nofollow">http://nhprof.com/Learn/Alert?name=DoNotUseImplicitTransactions</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Noam Gal</title>
		<link>http://jasondentler.com/blog/2009/09/part-8-daos-repositories-or-query-objects/comment-page-1/#comment-659</link>
		<dc:creator>Noam Gal</dc:creator>
		<pubDate>Tue, 08 Sep 2009 10:47:27 +0000</pubDate>
		<guid isPermaLink="false">http://jasondentler.com/blog/?p=402#comment-659</guid>
		<description>I&#039;ve noticed that in each DAO method, you specifically handle transactions, if no transaction is available. Doesn&#039;t NHibernate do this automatically? Wrap each database access in an implicit transaction (if no transaction is currently running)?</description>
		<content:encoded><![CDATA[<p>I&#8217;ve noticed that in each DAO method, you specifically handle transactions, if no transaction is available. Doesn&#8217;t NHibernate do this automatically? Wrap each database access in an implicit transaction (if no transaction is currently running)?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
