<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>betweenGo &#187; Hibernate</title>
	<atom:link href="http://betweengo.com/category/java/hibernate/feed/" rel="self" type="application/rss+xml" />
	<link>http://betweengo.com</link>
	<description>We make Ruby on Rails easy.  We make ATG easy.</description>
	<lastBuildDate>Tue, 06 Dec 2011 14:03:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Repository creating tables automatically</title>
		<link>http://betweengo.com/2008/08/01/repository-creating-tables-automatically/</link>
		<comments>http://betweengo.com/2008/08/01/repository-creating-tables-automatically/#comments</comments>
		<pubDate>Fri, 01 Aug 2008 14:48:33 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[Hibernate]]></category>
		<category><![CDATA[Repository]]></category>
		<category><![CDATA[ATG]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://betweengo.com/?p=256</guid>
		<description><![CDATA[Recently we noticed while running some ATG unit tests that tables were being created by the ATG repository if they had not already been created by our SQL scripts.  This was a functionality that I was unaware of but apparently it is not unique, Hibernate does this too.  I could not find any documentation about [...]
Related posts:<ol>
<li><a href='http://betweengo.com/2008/08/01/best-practices-creating-tables/' rel='bookmark' title='Best Practices for Creating Tables'>Best Practices for Creating Tables</a></li>
<li><a href='http://betweengo.com/2008/07/03/content-repository-in-acc/' rel='bookmark' title='Content Repository in ACC'>Content Repository in ACC</a></li>
<li><a href='http://betweengo.com/2008/05/28/invalid-column-type-sqlexception-with-atg-repository/' rel='bookmark' title='Invalid column type SQLException with ATG Repository'>Invalid column type SQLException with ATG Repository</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Recently we noticed while running some ATG unit tests that tables were being created by the ATG repository if they had not already been created by our SQL scripts.  This was a functionality that I was unaware of but apparently it is not unique, Hibernate does this too.  I could not find any documentation about this nor could I determine how to turn it off.</p>
<p>The ATG repository creates these tables using the repository definition and the defaults for column width and data type.  It does not seem to warn that it is creating these tables.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbetweengo.com%2F2008%2F08%2F01%2Frepository-creating-tables-automatically%2F&amp;title=Repository%20creating%20tables%20automatically" id="wpa2a_2"><img src="http://betweengo.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Related posts:<ol>
<li><a href='http://betweengo.com/2008/08/01/best-practices-creating-tables/' rel='bookmark' title='Best Practices for Creating Tables'>Best Practices for Creating Tables</a></li>
<li><a href='http://betweengo.com/2008/07/03/content-repository-in-acc/' rel='bookmark' title='Content Repository in ACC'>Content Repository in ACC</a></li>
<li><a href='http://betweengo.com/2008/05/28/invalid-column-type-sqlexception-with-atg-repository/' rel='bookmark' title='Invalid column type SQLException with ATG Repository'>Invalid column type SQLException with ATG Repository</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2008/08/01/repository-creating-tables-automatically/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HibernateException: Found two representations of same collection</title>
		<link>http://betweengo.com/2007/01/26/hibernateexception-found-two-representations-of-same-collection/</link>
		<comments>http://betweengo.com/2007/01/26/hibernateexception-found-two-representations-of-same-collection/#comments</comments>
		<pubDate>Fri, 26 Jan 2007 20:25:05 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[Hibernate]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://betweengo.com/hibernate/2007/01/26/hibernateexception-found-two-representations-of-same-collection/</guid>
		<description><![CDATA[Sometimes you might stumble upon this confusing exception. org.hibernate.HibernateException: Found two representations of same collection: com.betweengo.Foos This could have happened because after clearing a Hibernate session (session.clear()) you updated a property that contains a collection. I found just making sure to clear the session once seemed to fix the problem but that may not be [...]
Related posts:<ol>
<li><a href='http://betweengo.com/2008/05/15/size-of-collection-jsp-dsp/' rel='bookmark' title='Size of collection in a JSP/DSP page'>Size of collection in a JSP/DSP page</a></li>
<li><a href='http://betweengo.com/2008/03/05/phpmyadmin-not-starting/' rel='bookmark' title='phpMyAdmin not starting'>phpMyAdmin not starting</a></li>
<li><a href='http://betweengo.com/2007/01/26/93/' rel='bookmark' title='Catching Oracle exceptions'>Catching Oracle exceptions</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Sometimes you might stumble upon this confusing exception.</p>
<p><code>org.hibernate.HibernateException: Found two representations of same collection: com.betweengo.Foos<br />
</code></p>
<p>This could have happened because after clearing a Hibernate session (<code>session.clear()</code>) you updated a property that contains a collection. I found just making sure to clear the session once seemed to fix the problem but that may not be a suitable solution in more complex situations.</p>
<p>More information about this problem can be found at <a href="http://forum.hibernate.org/viewtopic.php?p=2231400">http://forum.hibernate.org/viewtopic.php?p=2231400.</a></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbetweengo.com%2F2007%2F01%2F26%2Fhibernateexception-found-two-representations-of-same-collection%2F&amp;title=HibernateException%3A%20Found%20two%20representations%20of%20same%20collection" id="wpa2a_4"><img src="http://betweengo.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Related posts:<ol>
<li><a href='http://betweengo.com/2008/05/15/size-of-collection-jsp-dsp/' rel='bookmark' title='Size of collection in a JSP/DSP page'>Size of collection in a JSP/DSP page</a></li>
<li><a href='http://betweengo.com/2008/03/05/phpmyadmin-not-starting/' rel='bookmark' title='phpMyAdmin not starting'>phpMyAdmin not starting</a></li>
<li><a href='http://betweengo.com/2007/01/26/93/' rel='bookmark' title='Catching Oracle exceptions'>Catching Oracle exceptions</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2007/01/26/hibernateexception-found-two-representations-of-same-collection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Catching Oracle exceptions</title>
		<link>http://betweengo.com/2007/01/26/93/</link>
		<comments>http://betweengo.com/2007/01/26/93/#comments</comments>
		<pubDate>Fri, 26 Jan 2007 20:01:19 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[Hibernate]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://betweengo.com/oracle/2007/01/26/93/</guid>
		<description><![CDATA[Oracle SQL queries can throw exceptions. For example in this query f there is no data then Oracle will throw a NO_DATA_FOUND exception. SELECT status_date INTO v_status_date FROM member WHERE member_id = p_member_id_in; ORA-01403: no data found If this query is part of a stored procedure and is called from Hibernate you will get this [...]
Related posts:<ol>
<li><a href='http://betweengo.com/2008/10/08/ruby-on-rails-and-oracle/' rel='bookmark' title='Ruby on Rails and Oracle'>Ruby on Rails and Oracle</a></li>
<li><a href='http://betweengo.com/2007/01/05/oracle-sequences/' rel='bookmark' title='Oracle Triggers'>Oracle Triggers</a></li>
<li><a href='http://betweengo.com/2006/11/21/howto-describe-a-table/' rel='bookmark' title='Describing Tables and Constraints in Oracle'>Describing Tables and Constraints in Oracle</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Oracle SQL queries can throw exceptions.  For example in this query f there is no data then Oracle will throw a NO_DATA_FOUND exception.</p>
<p><code>SELECT status_date INTO v_status_date FROM member WHERE member_id = p_member_id_in;</code></p>
<p><code>ORA-01403: no data found</code></p>
<p>If this query is part of a stored procedure and is called from Hibernate you will get this uninformative exception.</p>
<p><code>org.hibernate.exception.DataException: could not execute query</code></p>
<p>Oracle SQL, like many languages, has a try catch construct.  In this example you could do the following.</p>
<p><code>BEGIN<br />
&nbsp;&nbsp;SELECT status_date INTO v_status_date FROM member WHERE member_id = p_member_id_in;<br />
EXCEPTION<br />
&nbsp;&nbsp;WHEN NO_DATA_FOUND THEN<br />
&nbsp;&nbsp;&nbsp;&nbsp;v_status_date := NULL;<br />
END;</code></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbetweengo.com%2F2007%2F01%2F26%2F93%2F&amp;title=Catching%20Oracle%20exceptions" id="wpa2a_6"><img src="http://betweengo.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Related posts:<ol>
<li><a href='http://betweengo.com/2008/10/08/ruby-on-rails-and-oracle/' rel='bookmark' title='Ruby on Rails and Oracle'>Ruby on Rails and Oracle</a></li>
<li><a href='http://betweengo.com/2007/01/05/oracle-sequences/' rel='bookmark' title='Oracle Triggers'>Oracle Triggers</a></li>
<li><a href='http://betweengo.com/2006/11/21/howto-describe-a-table/' rel='bookmark' title='Describing Tables and Constraints in Oracle'>Describing Tables and Constraints in Oracle</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2007/01/26/93/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Log SQL on JBoss</title>
		<link>http://betweengo.com/2006/04/04/howto-log-sql-on-jboss/</link>
		<comments>http://betweengo.com/2006/04/04/howto-log-sql-on-jboss/#comments</comments>
		<pubDate>Wed, 05 Apr 2006 05:27:05 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[Hibernate]]></category>
		<category><![CDATA[JBoss]]></category>
		<category><![CDATA[JDBC]]></category>
		<category><![CDATA[Logging]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[log4j]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://betweengo.com/?p=74</guid>
		<description><![CDATA[Edit the log4j.xml in the conf directory as shown below to turn on SQL debugging of the JDBC CMP plugin. /apps/jboss/server/default/conf :-&#62;diff -c log4j.xml~ log4j.xml *** log4j.xml~ Mon Sep 30 18:09:27 2002 --- log4j.xml Tue Apr 4 20:41:18 2006 *************** *** 61,73 **** &#60;!-- ============================== --&#62; &#60;appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender"&#62; ! &#60;param name="Threshold" value="INFO"/&#62; &#60;param name="Target" [...]
Related posts:<ol>
<li><a href='http://betweengo.com/2008/07/05/enabling-trace-level-debugging-in-jboss/' rel='bookmark' title='Enabling Trace Level Debugging in JBoss'>Enabling Trace Level Debugging in JBoss</a></li>
<li><a href='http://betweengo.com/2009/05/04/unit-test-for-threaded-logging/' rel='bookmark' title='Unit Test for Threaded Logging'>Unit Test for Threaded Logging</a></li>
<li><a href='http://betweengo.com/2008/05/27/log4j-levels/' rel='bookmark' title='Log4j levels'>Log4j levels</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Edit the <code>log4j.xml</code> in the <code>conf</code> directory as shown below to turn on SQL debugging of the JDBC CMP plugin.</p>
<pre>/apps/jboss/server/default/conf :-&gt;diff -c log4j.xml~ log4j.xml
*** log4j.xml~  Mon Sep 30 18:09:27 2002
--- log4j.xml   Tue Apr  4 20:41:18 2006
***************
*** 61,73 ****
    &lt;!-- ============================== --&gt;

    &lt;appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender"&gt;
!     &lt;param name="Threshold" value="INFO"/&gt;
      &lt;param name="Target" value="System.out"/&gt;

      &lt;layout class="org.apache.log4j.PatternLayout"&gt;
        &lt;!-- The default pattern: Date Priority [Category] Message\\n --&gt;
        &lt;param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/&gt;

      &lt;/layout&gt;
    &lt;/appender&gt;

--- 61,79 ----
    &lt;!-- ============================== --&gt;

    &lt;appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender"&gt;
!     &lt;!--&lt;param name="Threshold" value="INFO"/&gt;--&gt;
!     &lt;param name="Threshold" value="DEBUG"/&gt;
      &lt;param name="Target" value="System.out"/&gt;

      &lt;layout class="org.apache.log4j.PatternLayout"&gt;
        &lt;!-- The default pattern: Date Priority [Category] Message\\n --&gt;
        &lt;param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/&gt;

      &lt;/layout&gt;
+
+     &lt;category name="org.jboss.ejb.plugins.cmp.jdbc"&gt;
+       &lt;priority value="DEBUG"/&gt;
+     &lt;/category&gt;
+
    &lt;/appender&gt;</pre>
<p>If you want to log Hibernate SQL statements:</p>
<pre>    &lt;category name="org.hibernate.SQL"&gt;
      &lt;priority value="DEBUG"/&gt;
    &lt;/category&gt;</pre>
<p>If you want to log everything Hibernate&#8217;s doing, including SQL statements, schema export, transactions, etc.:</p>
<pre>    &lt;category name="org.hibernate.SQL"&gt;
      &lt;priority value="DEBUG"/&gt;
    &lt;/category&gt;</pre>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbetweengo.com%2F2006%2F04%2F04%2Fhowto-log-sql-on-jboss%2F&amp;title=How%20to%20Log%20SQL%20on%20JBoss" id="wpa2a_8"><img src="http://betweengo.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Related posts:<ol>
<li><a href='http://betweengo.com/2008/07/05/enabling-trace-level-debugging-in-jboss/' rel='bookmark' title='Enabling Trace Level Debugging in JBoss'>Enabling Trace Level Debugging in JBoss</a></li>
<li><a href='http://betweengo.com/2009/05/04/unit-test-for-threaded-logging/' rel='bookmark' title='Unit Test for Threaded Logging'>Unit Test for Threaded Logging</a></li>
<li><a href='http://betweengo.com/2008/05/27/log4j-levels/' rel='bookmark' title='Log4j levels'>Log4j levels</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2006/04/04/howto-log-sql-on-jboss/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
