<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Easy Hibernate Transactions</title>
	<atom:link href="http://blog.kischuk.com/2004/04/23/easy-hibernate-transactions/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.kischuk.com/2004/04/23/easy-hibernate-transactions/</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Wed, 19 May 2010 15:39:28 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Rob Kischuk</title>
		<link>http://blog.kischuk.com/2004/04/23/easy-hibernate-transactions/#comment-206</link>
		<dc:creator>Rob Kischuk</dc:creator>
		<pubDate>Wed, 28 Apr 2004 14:25:12 +0000</pubDate>
		<guid isPermaLink="false">http://rkischuk.wordpress.com/2004/04/23/easy-hibernate-transactions/#comment-206</guid>
		<description>&lt;blockquote&gt;
Concerning the OpenSessionInFilter pattern, does it only work if the web and EJB containers are colocated ? I think that&#039;s a real pre-requisite if one has SLSBs (Stateless session beans) fronting DAOs (your Data Service objects). Care to comment ? fermat
&lt;/blockquote&gt;
&lt;p&gt;
A fine question.  To be honest, I&#039;m not certain, but I&#039;d imagine that it wouldn&#039;t work in that circumstance.  Since the session is in the ThreadLocal, and the Thread itself won&#039;t propagate to the remote container, I doubt the session will either, unless you explicitly pass it in your remote method call.
&lt;p&gt;
Typically, a physically removed business tier as you describe is fronted by a &lt;a href=&quot;http://java.sun.com/blueprints/patterns/SessionFacade.html&quot;&gt;Session Facade.  In this case, I&#039;d imagine that each invocation to the remote interface would represent a unit of work, and that it would be appropriate to wrap each remote method in a session.create() and session.close().  To automate this, as we have done for web requests, you might use an AOP interceptor.</description>
		<content:encoded><![CDATA[<blockquote><p>
Concerning the OpenSessionInFilter pattern, does it only work if the web and EJB containers are colocated ? I think that&#8217;s a real pre-requisite if one has SLSBs (Stateless session beans) fronting DAOs (your Data Service objects). Care to comment ? fermat
</p></blockquote>
<p>
A fine question.  To be honest, I&#8217;m not certain, but I&#8217;d imagine that it wouldn&#8217;t work in that circumstance.  Since the session is in the ThreadLocal, and the Thread itself won&#8217;t propagate to the remote container, I doubt the session will either, unless you explicitly pass it in your remote method call.
</p>
<p>
Typically, a physically removed business tier as you describe is fronted by a <a href="http://java.sun.com/blueprints/patterns/SessionFacade.html">Session Facade.  In this case, I&#8217;d imagine that each invocation to the remote interface would represent a unit of work, and that it would be appropriate to wrap each remote method in a session.create() and session.close().  To automate this, as we have done for web requests, you might use an AOP interceptor.</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tofu</title>
		<link>http://blog.kischuk.com/2004/04/23/easy-hibernate-transactions/#comment-205</link>
		<dc:creator>tofu</dc:creator>
		<pubDate>Sun, 25 Apr 2004 02:52:27 +0000</pubDate>
		<guid isPermaLink="false">http://rkischuk.wordpress.com/2004/04/23/easy-hibernate-transactions/#comment-205</guid>
		<description>Concerning the OpenSessionInFilter pattern, does it only work if the web and EJB containers are colocated ? I think that&#039;s a real pre-requisite if one has SLSBs (Stateless session beans) fronting DAOs (your Data Service objects). Care to comment ?

fermat</description>
		<content:encoded><![CDATA[<p>Concerning the OpenSessionInFilter pattern, does it only work if the web and EJB containers are colocated ? I think that&#8217;s a real pre-requisite if one has SLSBs (Stateless session beans) fronting DAOs (your Data Service objects). Care to comment ?</p>
<p>fermat</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Davide Baroncelli</title>
		<link>http://blog.kischuk.com/2004/04/23/easy-hibernate-transactions/#comment-204</link>
		<dc:creator>Davide Baroncelli</dc:creator>
		<pubDate>Fri, 23 Apr 2004 15:56:58 +0000</pubDate>
		<guid isPermaLink="false">http://rkischuk.wordpress.com/2004/04/23/easy-hibernate-transactions/#comment-204</guid>
		<description>I agree: spring is the way to go: Hibernate feels &quot;too low level&quot; a component, when one has learnt how to use it inside Spring: it&#039;s just too easy: check out the article juergen hoeller posted on the hibernate wiki, it&#039;s pretty clear and complete.</description>
		<content:encoded><![CDATA[<p>I agree: spring is the way to go: Hibernate feels &#8220;too low level&#8221; a component, when one has learnt how to use it inside Spring: it&#8217;s just too easy: check out the article juergen hoeller posted on the hibernate wiki, it&#8217;s pretty clear and complete.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: WoEyE</title>
		<link>http://blog.kischuk.com/2004/04/23/easy-hibernate-transactions/#comment-203</link>
		<dc:creator>WoEyE</dc:creator>
		<pubDate>Fri, 23 Apr 2004 15:15:27 +0000</pubDate>
		<guid isPermaLink="false">http://rkischuk.wordpress.com/2004/04/23/easy-hibernate-transactions/#comment-203</guid>
		<description>Besides transaction safety your solution has another advantage: lazy-loading! Typical DAO method implementations look like this: get a connection, do some sql, close connection. Hibernate can load collections on demand by using proxies. But if you close the connection inside your DAO lazy loading will not work outside the DAO. Therefore it is a good idea to open the session in a filter and close it at the end of the request processing. Spring has a ready to use filter for this: OpenSessionInViewFilter.</description>
		<content:encoded><![CDATA[<p>Besides transaction safety your solution has another advantage: lazy-loading! Typical DAO method implementations look like this: get a connection, do some sql, close connection. Hibernate can load collections on demand by using proxies. But if you close the connection inside your DAO lazy loading will not work outside the DAO. Therefore it is a good idea to open the session in a filter and close it at the end of the request processing. Spring has a ready to use filter for this: OpenSessionInViewFilter.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob Kischuk</title>
		<link>http://blog.kischuk.com/2004/04/23/easy-hibernate-transactions/#comment-202</link>
		<dc:creator>Rob Kischuk</dc:creator>
		<pubDate>Fri, 23 Apr 2004 12:37:07 +0000</pubDate>
		<guid isPermaLink="false">http://rkischuk.wordpress.com/2004/04/23/easy-hibernate-transactions/#comment-202</guid>
		<description>To the anonymous user - not sure what you mean by &quot;get an app server&quot; - this is within an app server.  The app server won&#039;t manage all this cruft for me unless I am using Entity Beans (no).
&lt;p&gt;
Regarding Spring - that&#039;s on my list of things to look into.  I&#039;ve looked at quick intros to it, but I never have enough time to actually sift through the xml and bean declarations to actually understand it.</description>
		<content:encoded><![CDATA[<p>To the anonymous user &#8211; not sure what you mean by &#8220;get an app server&#8221; &#8211; this is within an app server.  The app server won&#8217;t manage all this cruft for me unless I am using Entity Beans (no).</p>
<p>
Regarding Spring &#8211; that&#8217;s on my list of things to look into.  I&#8217;ve looked at quick intros to it, but I never have enough time to actually sift through the xml and bean declarations to actually understand it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ashish</title>
		<link>http://blog.kischuk.com/2004/04/23/easy-hibernate-transactions/#comment-201</link>
		<dc:creator>Ashish</dc:creator>
		<pubDate>Fri, 23 Apr 2004 11:17:52 +0000</pubDate>
		<guid isPermaLink="false">http://rkischuk.wordpress.com/2004/04/23/easy-hibernate-transactions/#comment-201</guid>
		<description>You might want to take a look at Spring. It wraps up Hibernate transaction management beautifully, allowing you to use declarative transaction management (using JTA or not, it&#039;s an option).</description>
		<content:encoded><![CDATA[<p>You might want to take a look at Spring. It wraps up Hibernate transaction management beautifully, allowing you to use declarative transaction management (using JTA or not, it&#8217;s an option).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://blog.kischuk.com/2004/04/23/easy-hibernate-transactions/#comment-200</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Fri, 23 Apr 2004 11:15:34 +0000</pubDate>
		<guid isPermaLink="false">http://rkischuk.wordpress.com/2004/04/23/easy-hibernate-transactions/#comment-200</guid>
		<description>.... or you could just get an app server :-)</description>
		<content:encoded><![CDATA[<p>&#8230;. or you could just get an app server <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>
