<?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: Using the unsaved-value attribute to prevent TransientObjectExceptions in Hibernate</title>
	<atom:link href="http://blog.xebia.com/2006/08/09/using-the-unsaved-value-attribute-to-prevent-transientobjectexceptions-in-hibernate/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.xebia.com/2006/08/09/using-the-unsaved-value-attribute-to-prevent-transientobjectexceptions-in-hibernate/</link>
	<description>Software development done right!</description>
	<lastBuildDate>Wed, 08 Feb 2012 14:41:38 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Age Mooy</title>
		<link>http://blog.xebia.com/2006/08/09/using-the-unsaved-value-attribute-to-prevent-transientobjectexceptions-in-hibernate/#comment-94907</link>
		<dc:creator>Age Mooy</dc:creator>
		<pubDate>Fri, 21 May 2010 14:00:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.xebia.com/2006/08/09/using-the-unsaved-value-attribute-to-prevent-transientobjectexceptions-in-hibernate/#comment-94907</guid>
		<description>Dude, this was way back in 2006 and I haven&#039;t used Hibernate in years. Your problem description is way to vague to determine any specific cause. I suggest Google and/or the manual.</description>
		<content:encoded><![CDATA[<p>Dude, this was way back in 2006 and I haven&#8217;t used Hibernate in years. Your problem description is way to vague to determine any specific cause. I suggest Google and/or the manual.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yashashree</title>
		<link>http://blog.xebia.com/2006/08/09/using-the-unsaved-value-attribute-to-prevent-transientobjectexceptions-in-hibernate/#comment-94883</link>
		<dc:creator>Yashashree</dc:creator>
		<pubDate>Thu, 20 May 2010 09:09:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.xebia.com/2006/08/09/using-the-unsaved-value-attribute-to-prevent-transientobjectexceptions-in-hibernate/#comment-94883</guid>
		<description>I am getting exception as &quot;PersistenceException: Unable to add new object to the datastore&quot;, when i am adding new values in one of my tables using hibernate pojo class having unsaved-value=null. Can you people tell me whether this exception is related to that unsaved-value attribute??.</description>
		<content:encoded><![CDATA[<p>I am getting exception as &#8220;PersistenceException: Unable to add new object to the datastore&#8221;, when i am adding new values in one of my tables using hibernate pojo class having unsaved-value=null. Can you people tell me whether this exception is related to that unsaved-value attribute??.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Maarten Winkels</title>
		<link>http://blog.xebia.com/2006/08/09/using-the-unsaved-value-attribute-to-prevent-transientobjectexceptions-in-hibernate/#comment-315</link>
		<dc:creator>Maarten Winkels</dc:creator>
		<pubDate>Tue, 29 Aug 2006 06:33:05 +0000</pubDate>
		<guid isPermaLink="false">http://blog.xebia.com/2006/08/09/using-the-unsaved-value-attribute-to-prevent-transientobjectexceptions-in-hibernate/#comment-315</guid>
		<description>Casper, you&#039;re probably right about using sequence numbers that start at 1 when using them for valus in a column. The tricky thing is, that when using Hibernates HiLoSequenceGenerator (too decrease load on the database when inserting a lot of records in a table with a PK based on a sequence), it uses the sequence to generate a range of numbers. The transformation maps the value of 0 to the range [ 1  - range_size+1], thus when range_size = 999, a sequnce that starts at 0 will produce the numbers [1 - 1000] first and then [1001 - 2000]. A sequence that starts at 1 will first returns numbers in the range [1001 - 2000], thus leaving a gap at the start.
In our case we mix IdGenerators, since some objects are persisted more often than others, we use simple SequenceGenerators for these types. These should be used with sequences that start at 1.</description>
		<content:encoded><![CDATA[<p>Casper, you&#8217;re probably right about using sequence numbers that start at 1 when using them for valus in a column. The tricky thing is, that when using Hibernates HiLoSequenceGenerator (too decrease load on the database when inserting a lot of records in a table with a PK based on a sequence), it uses the sequence to generate a range of numbers. The transformation maps the value of 0 to the range [ 1  - range_size+1], thus when range_size = 999, a sequnce that starts at 0 will produce the numbers [1 - 1000] first and then [1001 - 2000]. A sequence that starts at 1 will first returns numbers in the range [1001 - 2000], thus leaving a gap at the start.<br />
In our case we mix IdGenerators, since some objects are persisted more often than others, we use simple SequenceGenerators for these types. These should be used with sequences that start at 1.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Casper Groenen</title>
		<link>http://blog.xebia.com/2006/08/09/using-the-unsaved-value-attribute-to-prevent-transientobjectexceptions-in-hibernate/#comment-313</link>
		<dc:creator>Casper Groenen</dc:creator>
		<pubDate>Mon, 28 Aug 2006 15:05:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.xebia.com/2006/08/09/using-the-unsaved-value-attribute-to-prevent-transientobjectexceptions-in-hibernate/#comment-313</guid>
		<description>Maybe, you should let your sequences start at 1 (which most DBMSes do anyway).</description>
		<content:encoded><![CDATA[<p>Maybe, you should let your sequences start at 1 (which most DBMSes do anyway).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Serge Beaumont</title>
		<link>http://blog.xebia.com/2006/08/09/using-the-unsaved-value-attribute-to-prevent-transientobjectexceptions-in-hibernate/#comment-172</link>
		<dc:creator>Serge Beaumont</dc:creator>
		<pubDate>Sat, 12 Aug 2006 18:50:07 +0000</pubDate>
		<guid isPermaLink="false">http://blog.xebia.com/2006/08/09/using-the-unsaved-value-attribute-to-prevent-transientobjectexceptions-in-hibernate/#comment-172</guid>
		<description>IMHO it is a bug. I don&#039;t know Hibernate 3, but in 2 the unsaved value was essentially the same as whatever Java initializes an instance variable to when you don&#039;t provide an initializer:

String blah;

would mean a null value. int initializes to 0, etcetera. A Long initialized to 0 at least breaks backwards compaltibility.</description>
		<content:encoded><![CDATA[<p>IMHO it is a bug. I don&#8217;t know Hibernate 3, but in 2 the unsaved value was essentially the same as whatever Java initializes an instance variable to when you don&#8217;t provide an initializer:</p>
<p>String blah;</p>
<p>would mean a null value. int initializes to 0, etcetera. A Long initialized to 0 at least breaks backwards compaltibility.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lars Vonk</title>
		<link>http://blog.xebia.com/2006/08/09/using-the-unsaved-value-attribute-to-prevent-transientobjectexceptions-in-hibernate/#comment-157</link>
		<dc:creator>Lars Vonk</dc:creator>
		<pubDate>Fri, 11 Aug 2006 21:02:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.xebia.com/2006/08/09/using-the-unsaved-value-attribute-to-prevent-transientobjectexceptions-in-hibernate/#comment-157</guid>
		<description>This is probably an undocumented feature.The hibernate doc says: 
&quot;unsaved-value (optional - defaults to a &quot;sensible&quot; value)&quot; and &quot;The unsaved-value attribute is almost never needed in Hibernate3.&quot;. Well indeed almost...</description>
		<content:encoded><![CDATA[<p>This is probably an undocumented feature.The hibernate doc says:<br />
&#8220;unsaved-value (optional &#8211; defaults to a &#8220;sensible&#8221; value)&#8221; and &#8220;The unsaved-value attribute is almost never needed in Hibernate3.&#8221;. Well indeed almost&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- This Quick Cache file was built for (  blog.xebia.com/2006/08/09/using-the-unsaved-value-attribute-to-prevent-transientobjectexceptions-in-hibernate/feed/ ) in 0.46808 seconds, on Feb 9th, 2012 at 10:42 pm UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Feb 9th, 2012 at 11:42 pm UTC -->
