<?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: Hibernate &#8211; Difference between session&#8217;s get() and load()</title>
	<atom:link href="http://www.gmarwaha.com/blog/2007/01/16/hibernate-difference-between-sessions-get-and-load/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gmarwaha.com/blog/2007/01/16/hibernate-difference-between-sessions-get-and-load/</link>
	<description>Ganesh\</description>
	<lastBuildDate>Wed, 08 Sep 2010 08:45:02 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: okey oyna</title>
		<link>http://www.gmarwaha.com/blog/2007/01/16/hibernate-difference-between-sessions-get-and-load/comment-page-1/#comment-68577</link>
		<dc:creator>okey oyna</dc:creator>
		<pubDate>Sat, 20 Feb 2010 22:14:36 +0000</pubDate>
		<guid isPermaLink="false">http://gmarwaha.com/blog/?p=4#comment-68577</guid>
		<description>HI, I WANT TO KNOW IF IS POSSIBLE TO ADD A PAUSE BUTTON TO THE CARROUSEL WHEN AUTOSCROLL IS ENABLED.

THANKS AND… GREAT WORK!!</description>
		<content:encoded><![CDATA[<p>HI, I WANT TO KNOW IF IS POSSIBLE TO ADD A PAUSE BUTTON TO THE CARROUSEL WHEN AUTOSCROLL IS ENABLED.</p>
<p>THANKS AND… GREAT WORK!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: okey oyna</title>
		<link>http://www.gmarwaha.com/blog/2007/01/16/hibernate-difference-between-sessions-get-and-load/comment-page-1/#comment-63912</link>
		<dc:creator>okey oyna</dc:creator>
		<pubDate>Tue, 27 Oct 2009 11:16:55 +0000</pubDate>
		<guid isPermaLink="false">http://gmarwaha.com/blog/?p=4#comment-63912</guid>
		<description>Large organisations – both public and private – can be well known for being inflexible. But for initiatives like this (and those in the future) to have a better chance of succeeding we need to look at how we can bring down the barriers to change. This is too big an issue to get in to here it and the reasons are both big and many, from too many stakeholders requiring approval to a ‘wait until the summer vacation’ philosophy, from long term budget planning to knock-on affects across the organisation (change in department A means training/documentation/website of Department B needs to be changed first). Hmmmm, seemed to have moved away from TILE and on to a general rant offending the entire UK HE sector!</description>
		<content:encoded><![CDATA[<p>Large organisations – both public and private – can be well known for being inflexible. But for initiatives like this (and those in the future) to have a better chance of succeeding we need to look at how we can bring down the barriers to change. This is too big an issue to get in to here it and the reasons are both big and many, from too many stakeholders requiring approval to a ‘wait until the summer vacation’ philosophy, from long term budget planning to knock-on affects across the organisation (change in department A means training/documentation/website of Department B needs to be changed first). Hmmmm, seemed to have moved away from TILE and on to a general rant offending the entire UK HE sector!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: okey oyna</title>
		<link>http://www.gmarwaha.com/blog/2007/01/16/hibernate-difference-between-sessions-get-and-load/comment-page-1/#comment-63910</link>
		<dc:creator>okey oyna</dc:creator>
		<pubDate>Tue, 27 Oct 2009 11:13:39 +0000</pubDate>
		<guid isPermaLink="false">http://gmarwaha.com/blog/?p=4#comment-63910</guid>
		<description>The time for insert, used load is lower of the used get?????</description>
		<content:encoded><![CDATA[<p>The time for insert, used load is lower of the used get?????</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: darsane</title>
		<link>http://www.gmarwaha.com/blog/2007/01/16/hibernate-difference-between-sessions-get-and-load/comment-page-1/#comment-58732</link>
		<dc:creator>darsane</dc:creator>
		<pubDate>Tue, 16 Jun 2009 16:53:41 +0000</pubDate>
		<guid isPermaLink="false">http://gmarwaha.com/blog/?p=4#comment-58732</guid>
		<description>Thank you for information.</description>
		<content:encoded><![CDATA[<p>Thank you for information.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Victor Hernandez</title>
		<link>http://www.gmarwaha.com/blog/2007/01/16/hibernate-difference-between-sessions-get-and-load/comment-page-1/#comment-53424</link>
		<dc:creator>Victor Hernandez</dc:creator>
		<pubDate>Mon, 17 Nov 2008 19:44:19 +0000</pubDate>
		<guid isPermaLink="false">http://gmarwaha.com/blog/?p=4#comment-53424</guid>
		<description>HI, I WANT TO KNOW IF IS POSSIBLE TO ADD A PAUSE BUTTON TO THE CARROUSEL WHEN AUTOSCROLL IS ENABLED.

THANKS AND... GREAT WORK!!</description>
		<content:encoded><![CDATA[<p>HI, I WANT TO KNOW IF IS POSSIBLE TO ADD A PAUSE BUTTON TO THE CARROUSEL WHEN AUTOSCROLL IS ENABLED.</p>
<p>THANKS AND&#8230; GREAT WORK!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oyun</title>
		<link>http://www.gmarwaha.com/blog/2007/01/16/hibernate-difference-between-sessions-get-and-load/comment-page-1/#comment-52624</link>
		<dc:creator>Oyun</dc:creator>
		<pubDate>Thu, 11 Sep 2008 22:09:46 +0000</pubDate>
		<guid isPermaLink="false">http://gmarwaha.com/blog/?p=4#comment-52624</guid>
		<description>very thanks for you!! OyunX</description>
		<content:encoded><![CDATA[<p>very thanks for you!! OyunX</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Berdam</title>
		<link>http://www.gmarwaha.com/blog/2007/01/16/hibernate-difference-between-sessions-get-and-load/comment-page-1/#comment-39308</link>
		<dc:creator>Berdam</dc:creator>
		<pubDate>Tue, 08 Apr 2008 00:40:55 +0000</pubDate>
		<guid isPermaLink="false">http://gmarwaha.com/blog/?p=4#comment-39308</guid>
		<description>The time for insert, used load is lower of the used get?????</description>
		<content:encoded><![CDATA[<p>The time for insert, used load is lower of the used get?????</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chet</title>
		<link>http://www.gmarwaha.com/blog/2007/01/16/hibernate-difference-between-sessions-get-and-load/comment-page-1/#comment-443</link>
		<dc:creator>Chet</dc:creator>
		<pubDate>Mon, 22 Oct 2007 11:03:14 +0000</pubDate>
		<guid isPermaLink="false">http://gmarwaha.com/blog/?p=4#comment-443</guid>
		<description>Hi Ganesh,

Good post, though I seem to be reading it pretty late :).

I have a somewhat similar problem and thought you might interested in giving some input. Though Hibernate is not new to me, but the current project that I am handling is about 6 months old. And now we have the requirement of splitting the application into 2 (or more) parts. Since that was not an original requirement, the simple design of this application did not take into account this possibility.

The scenario is simple enough, with Hibernate configuration files and POJO files forming a layer between the service layer and the MySQL database. In the front end we have Struts based action classes. The service layer, creates a Hibernate session and uses it for the purpose and discards it on use. Now if we split the application, into 2 parts, there is bound to be sync problem between the 2 hibernate sessions each part creates.

So my problem is &quot;how do we maintain the two hibernate sessions in sync&quot;? Any alternate solution to this existing system can also be applied.

Thanks for you patience !!
Chet</description>
		<content:encoded><![CDATA[<p>Hi Ganesh,</p>
<p>Good post, though I seem to be reading it pretty late <img src='http://www.gmarwaha.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>I have a somewhat similar problem and thought you might interested in giving some input. Though Hibernate is not new to me, but the current project that I am handling is about 6 months old. And now we have the requirement of splitting the application into 2 (or more) parts. Since that was not an original requirement, the simple design of this application did not take into account this possibility.</p>
<p>The scenario is simple enough, with Hibernate configuration files and POJO files forming a layer between the service layer and the MySQL database. In the front end we have Struts based action classes. The service layer, creates a Hibernate session and uses it for the purpose and discards it on use. Now if we split the application, into 2 parts, there is bound to be sync problem between the 2 hibernate sessions each part creates.</p>
<p>So my problem is &#8220;how do we maintain the two hibernate sessions in sync&#8221;? Any alternate solution to this existing system can also be applied.</p>
<p>Thanks for you patience !!<br />
Chet</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James</title>
		<link>http://www.gmarwaha.com/blog/2007/01/16/hibernate-difference-between-sessions-get-and-load/comment-page-1/#comment-33</link>
		<dc:creator>James</dc:creator>
		<pubDate>Sat, 24 Mar 2007 19:38:00 +0000</pubDate>
		<guid isPermaLink="false">http://gmarwaha.com/blog/?p=4#comment-33</guid>
		<description>The fact that calling &lt;i&gt;Object load()&lt;/i&gt; twice in a single session throws an Exception (NonUniqueObjectException) is not a failing of Hibernate at all - in fact, it&#039;s unavoidable.&lt;br/&gt;&lt;br/&gt;When Hibernate loads an Object with load() (or with get() for that matter), the Object is always persistent - i.e., associated with the session. (Contrast this with merge(), where the object passed in remains transient or detached.) Therefore, the Object you pass in to load needs to return as a persistent Object. Those are the semantics of the method. Hibernate obviously can&#039;t have two separate persistent Java objects for one database record - if it did, how would it know which one&#039;s state to save?&lt;br/&gt;&lt;br/&gt;If there were a get() method to load state into an existing Object, it would do precisely the same thing, but having such a method wouldn&#039;t be logical - since get() can&#039;t load null state into the existing Object, and returning null is pretty much get()&#039;s only purpose.&lt;br/&gt;&lt;br/&gt;The difference with the Object-returning method is that, if there is an existing persistent Object already associated with the session, it just returns that Object - and therefore doesn&#039;t have the duplicate reference problem. (Hibernate refers to these internally as reload and load events respectively.)&lt;br/&gt;&lt;br/&gt;It was mentioned above that Hibernate is too complicated. Perhaps the real problem is that it looks so much easier than it is. A lot of people get confused about things like the one I just mentioned because they think of Hibernate as a simple wrapper around a database, whereas it&#039;s actually a fundamental shift in thinking about persistence. Anyway, good article - if only for the discussion it provoked.</description>
		<content:encoded><![CDATA[<p>The fact that calling <i>Object load()</i> twice in a single session throws an Exception (NonUniqueObjectException) is not a failing of Hibernate at all &#8211; in fact, it&#8217;s unavoidable.</p>
<p>When Hibernate loads an Object with load() (or with get() for that matter), the Object is always persistent &#8211; i.e., associated with the session. (Contrast this with merge(), where the object passed in remains transient or detached.) Therefore, the Object you pass in to load needs to return as a persistent Object. Those are the semantics of the method. Hibernate obviously can&#8217;t have two separate persistent Java objects for one database record &#8211; if it did, how would it know which one&#8217;s state to save?</p>
<p>If there were a get() method to load state into an existing Object, it would do precisely the same thing, but having such a method wouldn&#8217;t be logical &#8211; since get() can&#8217;t load null state into the existing Object, and returning null is pretty much get()&#8217;s only purpose.</p>
<p>The difference with the Object-returning method is that, if there is an existing persistent Object already associated with the session, it just returns that Object &#8211; and therefore doesn&#8217;t have the duplicate reference problem. (Hibernate refers to these internally as reload and load events respectively.)</p>
<p>It was mentioned above that Hibernate is too complicated. Perhaps the real problem is that it looks so much easier than it is. A lot of people get confused about things like the one I just mentioned because they think of Hibernate as a simple wrapper around a database, whereas it&#8217;s actually a fundamental shift in thinking about persistence. Anyway, good article &#8211; if only for the discussion it provoked.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://www.gmarwaha.com/blog/2007/01/16/hibernate-difference-between-sessions-get-and-load/comment-page-1/#comment-32</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Mon, 05 Mar 2007 10:39:00 +0000</pubDate>
		<guid isPermaLink="false">http://gmarwaha.com/blog/?p=4#comment-32</guid>
		<description>Real good discussion. Nice stuff Ganesh.</description>
		<content:encoded><![CDATA[<p>Real good discussion. Nice stuff Ganesh.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
