<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Hibernate AssertionFailure error when creating associations in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/hibernate-assertionfailure-error-when-creating-associations/m-p/242183#M195313</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;With Hibernate, you can't catch a DAO-level exception and continue as normal; the Hibernate Session must be considered to be corrupted i.e. you need to handle the exception outside of your transaction and redo the transaction with an alternative approach.&amp;nbsp; This is a function of Hibernate (as you can see from the flush exception you get) and will be avoidable when we run without Hibernate.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 May 2010 12:52:51 GMT</pubDate>
    <dc:creator>derek</dc:creator>
    <dc:date>2010-05-04T12:52:51Z</dc:date>
    <item>
      <title>Hibernate AssertionFailure error when creating associations</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/hibernate-assertionfailure-error-when-creating-associations/m-p/242180#M195310</link>
      <description>I don't get an AssociationExists error when I try to create an association that already exists. Instead, I get the following hibernate assertion failure:09:38:26,457 ERROR [org.hibernate.AssertionFailure#&amp;lt;init&amp;gt;] an assertion failure occured (this may indicate a bug in Hibernate, but is more li</description>
      <pubDate>Thu, 26 Nov 2009 09:50:24 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/hibernate-assertionfailure-error-when-creating-associations/m-p/242180#M195310</guid>
      <dc:creator>lee</dc:creator>
      <dc:date>2009-11-26T09:50:24Z</dc:date>
    </item>
    <item>
      <title>Re: Hibernate AssertionFailure error when creating associations</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/hibernate-assertionfailure-error-when-creating-associations/m-p/242181#M195311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here's the code I'm using btw:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;try {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;log.debug("nPushing " + node);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;nodeService.createAssociation(env, node, CustomContentModel.ASSOC_UPDATED_CONTENT);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;catch (AssociationExistsException assocEx){&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;log.debug(" – Association already exists");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;catch(Exception ex) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;log.debug("&amp;nbsp; –&amp;nbsp; FAILED");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't understand why the final catch doesn't seem to actually catch the hibernate exception.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any suggestions?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Nov 2009 11:48:21 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/hibernate-assertionfailure-error-when-creating-associations/m-p/242181#M195311</guid>
      <dc:creator>lee</dc:creator>
      <dc:date>2009-11-26T11:48:21Z</dc:date>
    </item>
    <item>
      <title>Re: Hibernate AssertionFailure error when creating associations</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/hibernate-assertionfailure-error-when-creating-associations/m-p/242182#M195312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I ran the following unit test on 3.1.2, just to make sure that the AssociationExistsException is still being thrown as appropriate&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;org.alfresco.repo.node.BaseNodeServiceTest.testDuplicateAssociationDetection()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This unit test is run during every Alfresco build, so we simply wouldn't release a build without this functionality working.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Your stack trace would suggest that the flush() that's used by createAssociation() is flushing out another problem that's causing Hibernate to complain. Perhaps there was a previous error in the same transaction?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you are still experiencing the problem, please provide a simple test case that reproduces the problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dave&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 May 2010 16:10:43 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/hibernate-assertionfailure-error-when-creating-associations/m-p/242182#M195312</guid>
      <dc:creator>dward</dc:creator>
      <dc:date>2010-05-01T16:10:43Z</dc:date>
    </item>
    <item>
      <title>Re: Hibernate AssertionFailure error when creating associations</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/hibernate-assertionfailure-error-when-creating-associations/m-p/242183#M195313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;With Hibernate, you can't catch a DAO-level exception and continue as normal; the Hibernate Session must be considered to be corrupted i.e. you need to handle the exception outside of your transaction and redo the transaction with an alternative approach.&amp;nbsp; This is a function of Hibernate (as you can see from the flush exception you get) and will be avoidable when we run without Hibernate.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 May 2010 12:52:51 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/hibernate-assertionfailure-error-when-creating-associations/m-p/242183#M195313</guid>
      <dc:creator>derek</dc:creator>
      <dc:date>2010-05-04T12:52:51Z</dc:date>
    </item>
  </channel>
</rss>

