<div dir="ltr"><div>And how about changing slightly our approach and implement a stable, dedicated APIs on both Hibernate and Infinispan side. This way the Hibernate 2LC module would simply glue those two together and should be fairly simple. </div><div><br></div><div>We could document such APIs and somewhat &quot;freeze&quot; them allowing only adding new methods but never changing or removing old ones.</div><div><br><div class="gmail_quote"><div dir="ltr">On Thu, Feb 16, 2017 at 12:31 PM Sanne Grinovero &lt;<a href="mailto:sanne@hibernate.org">sanne@hibernate.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto" class="gmail_msg">Have fun with the rewriting! <div dir="auto" class="gmail_msg">;) </div><div dir="auto" class="gmail_msg"><br class="gmail_msg"></div><div dir="auto" class="gmail_msg">More seriously, it might be worth to have a second module for Hibernate ORM 5.x to address Infinispan 9?</div><div dir="auto" class="gmail_msg">At least in depth testing, stressing and performance aspect won&#39;t be left to the last minute integration step. </div><div dir="auto" class="gmail_msg"><br class="gmail_msg"></div><div dir="auto" class="gmail_msg">Also, would it be worth to move such code to Infinispan? In such cases neither repository is ideal, but I&#39;d tend to prefer to integrate with the one which has the more stable and well defined integration point. </div><div dir="auto" class="gmail_msg">Historically that has been Hibernate, so hosting this code closer to Infinispan and then merely integrate with Hibernate would have been useful.</div><div dir="auto" class="gmail_msg"><br class="gmail_msg"></div><div dir="auto" class="gmail_msg">Alternatively, let&#39;s see if we can embrace JCache all-in. The architecture I had discussed with Alex Snaps for the Hibernate /JCache integration would allow for &quot;vendor specific extensions&quot; to bypass the spec on some specific points as needed. </div><div dir="auto" class="gmail_msg"><br class="gmail_msg"></div></div><div class="gmail_extra gmail_msg"><br class="gmail_msg"><div class="gmail_quote gmail_msg">On 16 Feb 2017 11:00, &quot;Galder ZamarreƱo&quot; &lt;<a href="mailto:galder@redhat.com" class="gmail_msg" target="_blank">galder@redhat.com</a>&gt; wrote:<br type="attribution" class="gmail_msg"><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br class="gmail_msg">
<br class="gmail_msg">
As I&#39;ve mentioned, I&#39;m working on trying to integrate Hibernate 2LC (5.x branch at the moment) with Infinispan 9.<br class="gmail_msg">
<br class="gmail_msg">
To start with, I tried to see if I could just run Hibernate 2LC 5.x, compiled with Infinispan 8, with an Infinispan 9 runtime. The first problem here was to do with changes to PrioritizedMethodMetadata [1].<br class="gmail_msg">
<br class="gmail_msg">
However, that above is the least of our problems... once I tried to compile with Infinispan 9, there are a lot of compilation errors.<br class="gmail_msg">
<br class="gmail_msg">
Here&#39;s a list of what I&#39;ve found out so far, based on the work in [2] which includes compilation errors and runtime issues I&#39;ve discovered:<br class="gmail_msg">
<br class="gmail_msg">
1. Plenty of interceptors have been moved from org.infinispan.interceptors.base and org.infinispan.interceptors packages to org.infinispan.interceptors.impl package.<br class="gmail_msg">
<br class="gmail_msg">
2. ModuleCommandFactory.fromStream now passes a cache name in ByteString instead of String.<br class="gmail_msg">
<br class="gmail_msg">
3. DataWriteCommand.setMetadata() method is gone. The reason for this is that FlagAffectedCommand does no longer extend MetadataAwareCommand.<br class="gmail_msg">
<br class="gmail_msg">
4. Interceptors cannot invoke invokeNextInterceptor() any more in parent, the method has been renamed to invokeNext() (in different class, AsyncInterceptor)<br class="gmail_msg">
<br class="gmail_msg">
5. A lot of interceptors now take flags as long instead of Set&lt;Flag&gt; which results in compilation error.<br class="gmail_msg">
<br class="gmail_msg">
6. BaseRpcInterceptor subclasses are now force abstract protected method getLog() to be implemented, again a compilation error.<br class="gmail_msg">
<br class="gmail_msg">
7. CallInterceptor no longer contains visit... methods, so all interceptors extending it need to extend CommandInterceptor and be placed just before CallInterceptor.<br class="gmail_msg">
<br class="gmail_msg">
7.1. As a result of that, interceptor positioning calls need to be changed.<br class="gmail_msg">
<br class="gmail_msg">
8. AdvancedCache.filterEntries() is gone, so need to find an alternative way to do the same.<br class="gmail_msg">
<br class="gmail_msg">
9. WriteCommand.getAffectedKeys() returns Collection instead of Set now.<br class="gmail_msg">
<br class="gmail_msg">
10. org.infinispan.filter.NullValueConverter is gone. I removed that as part of marshalling changes since it was not used anywhere within Infinispan repo, but Hibernate 2LC actually uses it.<br class="gmail_msg">
<br class="gmail_msg">
11. BeginInvalidationCommand and EndInvalidationCommand write directly the lockOwner via `output.writeObject(lockOwner)`, but this causes problem when the lockOwner is a CommandInvocationId since there&#39;s no externalizer for it any more. The reason for not having an externalizer is that CommandInvocationId is written via static CommandInvocationId.writeTo() calls.<br class="gmail_msg">
<br class="gmail_msg">
12. org.infinispan.commands.module.ExtendedModuleCommandFactory is gone.<br class="gmail_msg">
<br class="gmail_msg">
13. ReplicableCommand.setParameters() method is gone.<br class="gmail_msg">
<br class="gmail_msg">
14. BaseRpcCommand constructor takes a ByteString instead of String.<br class="gmail_msg">
<br class="gmail_msg">
15. ReplicableCommand implementations need to implement writeTo() and readFrom() methods.<br class="gmail_msg">
<br class="gmail_msg">
16. (test) BlockingInterceptor no longer can be added via AdvancedCache.addInterceptor() call because it does not extend CommandInterceptor any more.<br class="gmail_msg">
<br class="gmail_msg">
17. (test) org.infinispan.util.concurrent.ConcurrentHashSet has been moved.<br class="gmail_msg">
<br class="gmail_msg">
18. (test) TestingEntityCacheKey must be made extend ExternalPojo so that it can be externally marshalled.<br class="gmail_msg">
<br class="gmail_msg">
19. (test) 2lc-test-tcp.xml contains attributes that are no longer found by JGroups 4.x and throws errors.<br class="gmail_msg">
<br class="gmail_msg">
The question here is whether we should work towards making Infinispan 9 backwards compatible with Infinispan 8 as far as Hibernate 2LC integration is concerned.<br class="gmail_msg">
<br class="gmail_msg">
In theory, Infinispan 9 should be integrated with Hibernate 6.x onwards, but as always, Wildfly might have different opinions... @Paul?<br class="gmail_msg">
<br class="gmail_msg">
If we need to do something, the time to do it is now, before 9.Final.<br class="gmail_msg">
<br class="gmail_msg">
Cheers,<br class="gmail_msg">
<br class="gmail_msg">
p.s. A lot of tests still failing, so the work in [2] is nowhere near finished.<br class="gmail_msg">
<br class="gmail_msg">
[1] <a href="https://gist.github.com/galderz/e26ea9d4838a965500906a6df87e064a" rel="noreferrer" class="gmail_msg" target="_blank">https://gist.github.com/galderz/e26ea9d4838a965500906a6df87e064a</a><br class="gmail_msg">
[2] <a href="https://github.com/galderz/hibernate-orm/commit/5e36a021db4eaad75d835d321282eee6c62cc7c6" rel="noreferrer" class="gmail_msg" target="_blank">https://github.com/galderz/hibernate-orm/commit/5e36a021db4eaad75d835d321282eee6c62cc7c6</a><br class="gmail_msg">
--<br class="gmail_msg">
Galder ZamarreƱo<br class="gmail_msg">
Infinispan, Red Hat<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
_______________________________________________<br class="gmail_msg">
infinispan-dev mailing list<br class="gmail_msg">
<a href="mailto:infinispan-dev@lists.jboss.org" class="gmail_msg" target="_blank">infinispan-dev@lists.jboss.org</a><br class="gmail_msg">
<a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a></blockquote></div></div>
_______________________________________________<br class="gmail_msg">
infinispan-dev mailing list<br class="gmail_msg">
<a href="mailto:infinispan-dev@lists.jboss.org" class="gmail_msg" target="_blank">infinispan-dev@lists.jboss.org</a><br class="gmail_msg">
<a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a></blockquote></div></div></div>