<?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: JPA integration not working 100% for transient variables??? in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/jpa-integration-not-working-100-for-transient-variables/m-p/109163#M76600</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I do not have an async process. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'vecreated my own implementation, which generates a String from an entity (classname:id) and reloads the entity based on the information in the listener. This works without a problem. (It also has the advantage that, because I mix and match workflow and regular code, it makes sure only one EntityManager is used; no conflicts.)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A unit test, well it is happening as part of my own unit test, so I could strip that down… I'll give it a try.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Sep 2012 10:02:07 GMT</pubDate>
    <dc:creator>tbee</dc:creator>
    <dc:date>2012-09-06T10:02:07Z</dc:date>
    <item>
      <title>JPA integration not working 100% for transient variables???</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/jpa-integration-not-working-100-for-transient-variables/m-p/109161#M76598</link>
      <description>I've setup JPA integration and initially it seems to work, but I find a deviation.My entity classes all extend an AbstractBean class where the code for a.o. property change events is present. This class also has the possibility to block (ignore) these events (this is required when setting up default</description>
      <pubDate>Thu, 06 Sep 2012 08:52:51 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/jpa-integration-not-working-100-for-transient-variables/m-p/109161#M76598</guid>
      <dc:creator>tbee</dc:creator>
      <dc:date>2012-09-06T08:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: JPA integration not working 100% for transient variables???</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/jpa-integration-not-working-100-for-transient-variables/m-p/109162#M76599</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;BR /&gt;&lt;SPAN&gt;Do you have async behavior in your process definition?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you create a unit test that shows this behavior?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2012 09:32:42 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/jpa-integration-not-working-100-for-transient-variables/m-p/109162#M76599</guid>
      <dc:creator>trademak</dc:creator>
      <dc:date>2012-09-06T09:32:42Z</dc:date>
    </item>
    <item>
      <title>Re: JPA integration not working 100% for transient variables???</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/jpa-integration-not-working-100-for-transient-variables/m-p/109163#M76600</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I do not have an async process. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'vecreated my own implementation, which generates a String from an entity (classname:id) and reloads the entity based on the information in the listener. This works without a problem. (It also has the advantage that, because I mix and match workflow and regular code, it makes sure only one EntityManager is used; no conflicts.)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A unit test, well it is happening as part of my own unit test, so I could strip that down… I'll give it a try.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2012 10:02:07 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/jpa-integration-not-working-100-for-transient-variables/m-p/109163#M76600</guid>
      <dc:creator>tbee</dc:creator>
      <dc:date>2012-09-06T10:02:07Z</dc:date>
    </item>
    <item>
      <title>Re: JPA integration not working 100% for transient variables???</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/jpa-integration-not-working-100-for-transient-variables/m-p/109164#M76601</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yeah. Now that I've stripped it down far enough, the problem is gone. So there is some kind of conflict between what I do in the frame of my application, and how Activiti restores the entity. So I can't give you a simple unit test that reproduces the problem. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I do know is that:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- in the activiti implementation a final field ends up being null (that is very strange)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- using my simple implementation of encode-as-string and find-using-string in the same context works fine&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My question would be: what magic are you guys doing to restore the entity? It seems the constructor is somehow by passed. (Note that I have 5 layer deep entity classes.) As said, this simple piece of code works fine:&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt; static public &amp;lt;T&amp;gt; T fromId(Object id)&lt;BR /&gt; {&lt;BR /&gt;&amp;nbsp; try&lt;BR /&gt;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; // preconditions&lt;BR /&gt;&amp;nbsp;&amp;nbsp; String lId = "" + id;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; if ("null".equals(lId)) return null;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; // split id&lt;BR /&gt;&amp;nbsp;&amp;nbsp; int lIdx = lId.indexOf(":");&lt;BR /&gt;&amp;nbsp;&amp;nbsp; String lClassname = lId.substring(0, lIdx);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; BigInteger lPK = new BigInteger(lId.substring(lIdx + 1));&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; // get entity&lt;BR /&gt;&amp;nbsp;&amp;nbsp; EntityManager lEntityManager = EntityManagerFinder.find();&lt;BR /&gt;&amp;nbsp;&amp;nbsp; T lEntity = (T)lEntityManager.find(Class.forName(lClassname), lPK);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; return lEntity;&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp; catch (ClassNotFoundException e) { throw new IllegalStateException(e); }&lt;BR /&gt; }&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;I can offer you to take a remote-desktop peek in my development environment.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2012 10:45:14 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/jpa-integration-not-working-100-for-transient-variables/m-p/109164#M76601</guid>
      <dc:creator>tbee</dc:creator>
      <dc:date>2012-09-06T10:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: JPA integration not working 100% for transient variables???</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/jpa-integration-not-working-100-for-transient-variables/m-p/109165#M76602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hmmm. I've taken a peek at what is in the ACT_RU_VARIABLE table and I see that my approach stores a "nl.o837.frozn.bm.Application:74" text. However, Activiti seems to store a serializable. Do you actually serialize and store the whole entity? That should not be, the user manual says "&lt;/SPAN&gt;&lt;EM&gt;When the variable is requested the next time, it will be loaded from the EntityManager based on the class and Id stored.&lt;/EM&gt;&lt;SPAN&gt;".&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2012 13:32:57 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/jpa-integration-not-working-100-for-transient-variables/m-p/109165#M76602</guid>
      <dc:creator>tbee</dc:creator>
      <dc:date>2012-09-06T13:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: JPA integration not working 100% for transient variables???</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/jpa-integration-not-working-100-for-transient-variables/m-p/109166#M76603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It's the "transient" keyword; it tells Java's serializer to not serialize a field. And that is how you get a final field to become null…&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2012 14:58:29 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/jpa-integration-not-working-100-for-transient-variables/m-p/109166#M76603</guid>
      <dc:creator>tbee</dc:creator>
      <dc:date>2012-09-06T14:58:29Z</dc:date>
    </item>
  </channel>
</rss>

