<?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: Hibernate Tip &#8211; Session Closing for Large Imports</title>
	<atom:link href="http://blog.kischuk.com/2004/08/18/hibernate-tip-session-closing-for-large-imports/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.kischuk.com/2004/08/18/hibernate-tip-session-closing-for-large-imports/</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: Davide Baroncelli</title>
		<link>http://blog.kischuk.com/2004/08/18/hibernate-tip-session-closing-for-large-imports/#comment-105</link>
		<dc:creator>Davide Baroncelli</dc:creator>
		<pubDate>Tue, 14 Sep 2004 03:39:21 +0000</pubDate>
		<guid isPermaLink="false">http://rkischuk.wordpress.com/2004/08/18/hibernate-tip-session-closing-for-large-imports/#comment-105</guid>
		<description>Nobody showed that Hibernate &quot;doesn&#039;t work right&quot;: on the contrary, someone pointed out that there is a reason why Hibernate works this way, and it&#039;s a (very useful, indeed) feature. Anyway, for anyone that has used Hibernate for more than 10 minutes, and has spent a couple of hours reading the doc, the whole point of this blog entry and the OJB comments is totally screwed, and the &quot;jboss is evil&quot; comments  are incredibly lame. Note: I am NOT on the Hibernate/Jboss team, only a happy Hibernate user, which respects a lot Gavin&#039;s work: try to give a look to the inner Hibernate architecture, before saying it&#039;s &quot;shitty&quot;.</description>
		<content:encoded><![CDATA[<p>Nobody showed that Hibernate &#8220;doesn&#8217;t work right&#8221;: on the contrary, someone pointed out that there is a reason why Hibernate works this way, and it&#8217;s a (very useful, indeed) feature. Anyway, for anyone that has used Hibernate for more than 10 minutes, and has spent a couple of hours reading the doc, the whole point of this blog entry and the OJB comments is totally screwed, and the &#8220;jboss is evil&#8221; comments  are incredibly lame. Note: I am NOT on the Hibernate/Jboss team, only a happy Hibernate user, which respects a lot Gavin&#8217;s work: try to give a look to the inner Hibernate architecture, before saying it&#8217;s &#8220;shitty&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://blog.kischuk.com/2004/08/18/hibernate-tip-session-closing-for-large-imports/#comment-104</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Mon, 13 Sep 2004 13:47:59 +0000</pubDate>
		<guid isPermaLink="false">http://rkischuk.wordpress.com/2004/08/18/hibernate-tip-session-closing-for-large-imports/#comment-104</guid>
		<description>Of course, any time Hibernate doesn&#039;t work right, it&#039;s the users fault.  The authors love to point that out every time they can.

Don&#039;t you love it when a vendor tells it&#039;s users that they are wrong so much?</description>
		<content:encoded><![CDATA[<p>Of course, any time Hibernate doesn&#8217;t work right, it&#8217;s the users fault.  The authors love to point that out every time they can.</p>
<p>Don&#8217;t you love it when a vendor tells it&#8217;s users that they are wrong so much?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason Carreira</title>
		<link>http://blog.kischuk.com/2004/08/18/hibernate-tip-session-closing-for-large-imports/#comment-103</link>
		<dc:creator>Jason Carreira</dc:creator>
		<pubDate>Mon, 13 Sep 2004 11:56:19 +0000</pubDate>
		<guid isPermaLink="false">http://rkischuk.wordpress.com/2004/08/18/hibernate-tip-session-closing-for-large-imports/#comment-103</guid>
		<description>In addition to the Hibernate tips above, I&#039;ll add that in my experience building large scale batch processing frameworks, it&#039;s usually a good idea to commit every x records so as not to keep a transaction open while you process 100,000+ records. It does make batch recovery a bit more tricky though, since it&#039;s not all one transaction, but you could create a temp table or something and do a &quot;select into&quot;...</description>
		<content:encoded><![CDATA[<p>In addition to the Hibernate tips above, I&#8217;ll add that in my experience building large scale batch processing frameworks, it&#8217;s usually a good idea to commit every x records so as not to keep a transaction open while you process 100,000+ records. It does make batch recovery a bit more tricky though, since it&#8217;s not all one transaction, but you could create a temp table or something and do a &#8220;select into&#8221;&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gavin</title>
		<link>http://blog.kischuk.com/2004/08/18/hibernate-tip-session-closing-for-large-imports/#comment-102</link>
		<dc:creator>Gavin</dc:creator>
		<pubDate>Tue, 24 Aug 2004 21:11:56 +0000</pubDate>
		<guid isPermaLink="false">http://rkischuk.wordpress.com/2004/08/18/hibernate-tip-session-closing-for-large-imports/#comment-102</guid>
		<description>The comments about OJB are incredibly ill-informed.

The reason for the &quot;cache everything unless explicitly told not to&quot; policy is to enable automatic dirty checking, a feature that OJB does not have in its PersistenceBroker API.

You can *at any time* flush() then clear() the session cache. It&#039;s funny. You will need to explicitly call flush()/clear() much, much, much less often in your application than you would need to explicitly call update() in OJB PersistenceBroker.

So you guys are so wrong it hurts.</description>
		<content:encoded><![CDATA[<p>The comments about OJB are incredibly ill-informed.</p>
<p>The reason for the &#8220;cache everything unless explicitly told not to&#8221; policy is to enable automatic dirty checking, a feature that OJB does not have in its PersistenceBroker API.</p>
<p>You can *at any time* flush() then clear() the session cache. It&#8217;s funny. You will need to explicitly call flush()/clear() much, much, much less often in your application than you would need to explicitly call update() in OJB PersistenceBroker.</p>
<p>So you guys are so wrong it hurts.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Juha Komulainen</title>
		<link>http://blog.kischuk.com/2004/08/18/hibernate-tip-session-closing-for-large-imports/#comment-101</link>
		<dc:creator>Juha Komulainen</dc:creator>
		<pubDate>Sat, 21 Aug 2004 16:18:03 +0000</pubDate>
		<guid isPermaLink="false">http://rkischuk.wordpress.com/2004/08/18/hibernate-tip-session-closing-for-large-imports/#comment-101</guid>
		<description>&lt;p&gt;
  Yes, if you have a large batch of data, it is
  probably worthwhile to call Session.flush()
  every once in a while. This will execute the
  SQL to insert the data into the database, but
  won&#039;t remove the object from session cache and
  your session will still grow. So you&#039;ll
  also want to remove the object from session
  cache by calling Session.evict(Object) after
  flushing.
&lt;/p&gt;
&lt;p&gt;
  Of course this manual flushing and evicting is
  only necessary when you have huge amount of data
  (like your 40,000 records) to insert in batch.
&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>
  Yes, if you have a large batch of data, it is<br />
  probably worthwhile to call Session.flush()<br />
  every once in a while. This will execute the<br />
  SQL to insert the data into the database, but<br />
  won&#8217;t remove the object from session cache and<br />
  your session will still grow. So you&#8217;ll<br />
  also want to remove the object from session<br />
  cache by calling Session.evict(Object) after<br />
  flushing.
</p>
<p>
  Of course this manual flushing and evicting is<br />
  only necessary when you have huge amount of data<br />
  (like your 40,000 records) to insert in batch.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adrian</title>
		<link>http://blog.kischuk.com/2004/08/18/hibernate-tip-session-closing-for-large-imports/#comment-100</link>
		<dc:creator>Adrian</dc:creator>
		<pubDate>Thu, 19 Aug 2004 01:28:47 +0000</pubDate>
		<guid isPermaLink="false">http://rkischuk.wordpress.com/2004/08/18/hibernate-tip-session-closing-for-large-imports/#comment-100</guid>
		<description>have you tried to flush() your Hibernate session ? I&#039;s significantly cheaper than reopening a session and you can do it in smartly sized batches.

My experience shown that Castor &#039;JDO&#039; and OJB are slower that Hibernate if your code is properly tuned.</description>
		<content:encoded><![CDATA[<p>have you tried to flush() your Hibernate session ? I&#8217;s significantly cheaper than reopening a session and you can do it in smartly sized batches.</p>
<p>My experience shown that Castor &#8216;JDO&#8217; and OJB are slower that Hibernate if your code is properly tuned.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob Kischuk</title>
		<link>http://blog.kischuk.com/2004/08/18/hibernate-tip-session-closing-for-large-imports/#comment-99</link>
		<dc:creator>Rob Kischuk</dc:creator>
		<pubDate>Wed, 18 Aug 2004 23:21:54 +0000</pubDate>
		<guid isPermaLink="false">http://rkischuk.wordpress.com/2004/08/18/hibernate-tip-session-closing-for-large-imports/#comment-99</guid>
		<description>Already had to dump OJB.
&lt;p&gt;
We gave OJB the first shot.  The problem we ran into had to do with OJB/JBoss and some silly eager-release attribute.  Memory isn&#039;t perfect on this one, but essentially if it was false, it led to some resource consumption error.  If true, then it would only load the first element of a collection, the 2nd element would load on the 2nd call to that collection, and so on.
&lt;p&gt;
In short, no matter which way we set the stupid configuration parameter, there was going to be an unacceptable consequence.  Thought inconvenient, Hibernate is working for us.</description>
		<content:encoded><![CDATA[<p>Already had to dump OJB.</p>
<p>
We gave OJB the first shot.  The problem we ran into had to do with OJB/JBoss and some silly eager-release attribute.  Memory isn&#8217;t perfect on this one, but essentially if it was false, it led to some resource consumption error.  If true, then it would only load the first element of a collection, the 2nd element would load on the 2nd call to that collection, and so on.
</p>
<p>
In short, no matter which way we set the stupid configuration parameter, there was going to be an unacceptable consequence.  Thought inconvenient, Hibernate is working for us.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://blog.kischuk.com/2004/08/18/hibernate-tip-session-closing-for-large-imports/#comment-98</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Wed, 18 Aug 2004 17:39:14 +0000</pubDate>
		<guid isPermaLink="false">http://rkischuk.wordpress.com/2004/08/18/hibernate-tip-session-closing-for-large-imports/#comment-98</guid>
		<description>Yes, we found this problem.  The solution to the problem - switch to OJB.  Our problems with the pointless &quot;cache everything until you commit&quot; feature went away.
&lt;br&gt;
The Hibernate folks keep saying - why hit the database when you don&#039;t have to.  I think the opposite, if you are writing data to the database, why cache it up.  You are going to have to write it at some point, how does caching a write help?  A database is extremely good at handling transactions, why replicate it in Hibernate and have users have problems like this.
&lt;br&gt;
Of course, the JBoss people are very good at implementing very shitty things and not listening to their users about fixing them.  Like the JBoss classloader and the multi-cast clustering.
&lt;br&gt;
Switch to OJB and it will run even faster.</description>
		<content:encoded><![CDATA[<p>Yes, we found this problem.  The solution to the problem &#8211; switch to OJB.  Our problems with the pointless &#8220;cache everything until you commit&#8221; feature went away.<br />
<br />
The Hibernate folks keep saying &#8211; why hit the database when you don&#8217;t have to.  I think the opposite, if you are writing data to the database, why cache it up.  You are going to have to write it at some point, how does caching a write help?  A database is extremely good at handling transactions, why replicate it in Hibernate and have users have problems like this.<br />
<br />
Of course, the JBoss people are very good at implementing very shitty things and not listening to their users about fixing them.  Like the JBoss classloader and the multi-cast clustering.<br />
<br />
Switch to OJB and it will run even faster.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
