<p><br>
On May 22, 2012 9:43 AM, &quot;David M. Lloyd&quot; &lt;<a href="mailto:david.lloyd@redhat.com">david.lloyd@redhat.com</a>&gt; wrote:<br>
&gt;<br>
&gt; On 05/22/2012 09:38 AM, Scott Marlow wrote:<br>
&gt;&gt;<br>
&gt;&gt; On 05/22/2012 10:14 AM, David M. Lloyd wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; On 05/22/2012 09:10 AM, Scott Marlow wrote:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; On 05/21/2012 06:40 PM, Steve Ebersole wrote:<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Hey all, just to tie this up with a bow I wanted to send my take away<br>
&gt;&gt;&gt;&gt;&gt; from the discussions we had on IRC and make sure everyone had the same<br>
&gt;&gt;&gt;&gt;&gt; take away. Jason and David, wanted to thank you guys again for your<br>
&gt;&gt;&gt;&gt;&gt; time<br>
&gt;&gt;&gt;&gt;&gt; and input. It really helped out. I also went ahead and copied/pasted<br>
&gt;&gt;&gt;&gt;&gt; the<br>
&gt;&gt;&gt;&gt;&gt; transcript so we had record of discussion.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; The basic idea is to control this via a specific deployment descriptor<br>
&gt;&gt;&gt;&gt;&gt; (jboss-hibernate.xml or somesuch).<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; My understanding is that this jboss-hibernate.xml is an optional<br>
&gt;&gt;&gt;&gt; deployment descriptor that would be used by a deployment (EE or non-EE)<br>
&gt;&gt;&gt;&gt; that wants to use any of the following technologies:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; * Hibernate Search<br>
&gt;&gt;&gt;&gt; * Hibernate OGM<br>
&gt;&gt;&gt;&gt; * Hibernate Integrator module implementation<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; The result of including a jboss-hibernate.xml, would be that the<br>
&gt;&gt;&gt;&gt; deployment includes the needed Hibernate modules (Hibernate<br>
&gt;&gt;&gt;&gt; Search/OGM/other custom modules).<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; If there is no jboss-hibernate.xml, there would be no change from<br>
&gt;&gt;&gt;&gt; current AS behaviour (OGM could be packaged with the application but<br>
&gt;&gt;&gt;&gt; cannot be used as a module like other persistence providers).<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; It sounds like you&#39;re implying that a regular JavaEE application with no<br>
&gt;&gt;&gt; JBoss-specific descriptors in it cannot use JPA. Is this correct?<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; No, I didn&#39;t intend to imply that. I&#39;ll restate with fewer negatives. ;)<br>
&gt;&gt; I just meant that standard EE deployment will continue to work for<br>
&gt;&gt; Hibernate ORM as the persistence provider. JavaEE applications that<br>
&gt;&gt; contain zero JBoss-specific descriptors, can continue to use JPA.<br>
&gt;&gt;<br>
&gt;&gt; Hibernate OGM/Search/Other Integrator applications will need to have a<br>
&gt;&gt; JBoss-specific descriptor (either jboss-hibernate.xml or<br>
&gt;&gt; jboss-deployment-structure.xml).<br>
&gt;<br>
&gt;<br>
&gt; OK.<br>
&gt;<br>
&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; This in effect will allow Hibernate ORM to use the application<br>
&gt;&gt;&gt;&gt; deployment as a composite module that also contains the Hibernate<br>
&gt;&gt;&gt;&gt; Search/OGM/Other Integrator module implementation(s).<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; That&#39;s fine assuming that we have JPA out of the box.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; This might require some Hibernate ORM changes or not (depending on<br>
&gt;&gt;&gt;&gt; whether its service loader searches in the TCCL currently). We can<br>
&gt;&gt;&gt;&gt; probably use the jboss-deployment-structure.xml as an alternative (short<br>
&gt;&gt;&gt;&gt; term solution) before we have this new Hibernate deployer that looks for<br>
&gt;&gt;&gt;&gt; the presence of the jboss-hibernate.xml file. I think more discussion is<br>
&gt;&gt;&gt;&gt; needed about the contents of jboss-hibernate.xml before we can implement<br>
&gt;&gt;&gt;&gt; that.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; The rule could probably be, if there&#39;s a jboss-hibernate.xml then use<br>
&gt;&gt;&gt; that to configure, else use TCCL. That should work in most cases (though<br>
&gt;&gt;&gt; it might break if they bundle certain combinations of JARs; this should<br>
&gt;&gt;&gt; be tested).<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; It seems like the TCCL could be used in Hibernate 4.1.4 (which doesn&#39;t<br>
&gt;&gt; require changing Hibernate ORM).<br>
&gt;<br>
&gt;<br>
&gt; I don&#39;t think we&#39;ll require any such changes regardless, from what Steve was saying.</p>
<p>One thing that makes me nervous here is that Hibernate would hold on to these classloaders until the SessionFactory is closed (technically until its BootstrapServiceRegistry is released).  Couldn&#39;t this present a problem in terms of classloader leaking in cases where the application is managing the SessionFactory lifecycle and the SessionFactory is not closed?</p>

<p>&gt;<br>
&gt;<br>
&gt;&gt; Regarding the jboss-hibernate.xml, it sounds like the binary<br>
&gt;&gt; representation could be a set of static module classloader references<br>
&gt;&gt; based on the user carefully specifying which Hibernate technologies to<br>
&gt;&gt; use for the deployment to be used by the ORM service loader.</p>
<p>Do you mean a product of all possible combinations of Hibernate modules?  I personally dont think that is the best representation.  At best, where the possibility set is known up front (aka there are no custom user modules), it seems wasteful to define so many modules; though perhaps there is not any real practical problem with that. Worst case though there might be custom user modules involved.<br>

</p>