Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Hibernate 5.2.x #5

Merged
merged 1 commit into from Oct 4, 2016
Merged

Support Hibernate 5.2.x #5

merged 1 commit into from Oct 4, 2016

Conversation

hho
Copy link
Contributor

@hho hho commented Sep 26, 2016

Moves hazelcast-hibernate5 to a module (thus the many touched files) and adds a new Maven artifact, hazelcast-hibernate52.

The hazelcast-hibernate52 artifact uses shading to minimize its own code (otherwise, all classes except 4 would've been duplicated). I'm not sure how well this works as an OSGi bundle (and I don't know how to test it).

Closes #3

@mesutcelik
Copy link
Contributor

run-lab-run

@mesutcelik
Copy link
Contributor

@hho ,

It doesn't look like test classes are compiling with your solution in hazelcast-hibernate52 module. If we can't find a better solution, we might unfortunately have to be duplicating the sources.

@hasancelik
Do we have a PR builder for this repository?

@hho
Copy link
Contributor Author

hho commented Sep 28, 2016

What test classes don't compile? 😨 The ones inside the project? Those are reused from the hibernate5 module – and they compile, run and pass:

Maven output

C:\devel\jdk1.8.0_101\bin\java -Dmaven.multiModuleProjectDirectory=C:\projects\hazelcast-hibernate5\hazelcast-hibernate52 -Dmaven.home=C:\devel\idea\plugins\maven\lib\maven3 -Dclassworlds.conf=C:\devel\idea\plugins\maven\lib\maven3\bin\m2.conf -Didea.launcher.port=7534 -Didea.launcher.bin.path=C:\devel\idea\bin -Dfile.encoding=UTF-8 -classpath C:\devel\idea\plugins\maven\lib\maven3\boot\plexus-classworlds-2.5.2.jar;C:\devel\idea\lib\idea_rt.jar com.intellij.rt.execution.application.AppMain org.codehaus.classworlds.Launcher -Didea.version=2016.3 test
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building hazelcast-hibernate52 1.0.2-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ hazelcast-hibernate52 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\projects\hazelcast-hibernate5\hazelcast-hibernate52\src\main\resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ hazelcast-hibernate52 ---
[INFO] Compiling 4 source files to C:\projects\hazelcast-hibernate5\hazelcast-hibernate52\target\classes
[INFO] 
[INFO] --- animal-sniffer-maven-plugin:1.14:check (source-java6-check) @ hazelcast-hibernate52 ---
[INFO] Checking unresolved references to org.codehaus.mojo.signature:java16:1.0
[INFO] 
[INFO] --- maven-bundle-plugin:2.3.7:manifest (bundle-manifest) @ hazelcast-hibernate52 ---
[WARNING] Manifest com.hazelcast:hazelcast-hibernate52:jar:1.0.2-SNAPSHOT : Did not find matching referal for !org.junit
[WARNING] Manifest com.hazelcast:hazelcast-hibernate52:jar:1.0.2-SNAPSHOT : Did not find matching referal for org.apache.log4j.*
[WARNING] Manifest com.hazelcast:hazelcast-hibernate52:jar:1.0.2-SNAPSHOT : Did not find matching referal for org.apache.logging.log4j.*
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ hazelcast-hibernate52 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 6 resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @ hazelcast-hibernate52 ---
[INFO] Compiling 30 source files to C:\projects\hazelcast-hibernate5\hazelcast-hibernate52\target\test-classes
[INFO] 
[INFO] --- maven-surefire-plugin:2.18.1:test (default-test) @ hazelcast-hibernate52 ---
[INFO] Surefire report directory: C:\projects\hazelcast-hibernate5\hazelcast-hibernate52\target\surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running com.hazelcast.hibernate.RegionFactoryQueryTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 13.003 sec - in com.hazelcast.hibernate.RegionFactoryQueryTest
Running com.hazelcast.hibernate.distributed.LockEntryProcessorTest
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.091 sec - in com.hazelcast.hibernate.distributed.LockEntryProcessorTest
Running com.hazelcast.hibernate.NaturalIdTest
Tests run: 18, Failures: 0, Errors: 0, Skipped: 4, Time elapsed: 12.768 sec - in com.hazelcast.hibernate.NaturalIdTest
Running com.hazelcast.hibernate.distributed.UpdateEntryProcessorTest
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.004 sec - in com.hazelcast.hibernate.distributed.UpdateEntryProcessorTest
Running com.hazelcast.hibernate.serialization.HibernateSerializationHookNonAvailableTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.855 sec - in com.hazelcast.hibernate.serialization.HibernateSerializationHookNonAvailableTest
Running com.hazelcast.hibernate.CustomPropertiesTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 11.187 sec - in com.hazelcast.hibernate.CustomPropertiesTest
Running com.hazelcast.hibernate.region.HazelcastTimestampsRegionTest
Tests run: 10, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.107 sec - in com.hazelcast.hibernate.region.HazelcastTimestampsRegionTest
Running com.hazelcast.hibernate.distributed.UnlockEntryProcessorTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.006 sec - in com.hazelcast.hibernate.distributed.UnlockEntryProcessorTest
Running com.hazelcast.hibernate.VersionAwareMapMergePolicyTest
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec - in com.hazelcast.hibernate.VersionAwareMapMergePolicyTest
Running com.hazelcast.hibernate.region.HazelcastQueryResultsRegionTest
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.005 sec - in com.hazelcast.hibernate.region.HazelcastQueryResultsRegionTest
Running com.hazelcast.hibernate.RegionFactoryDefaultTest
Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.499 sec - in com.hazelcast.hibernate.RegionFactoryDefaultTest
Running com.hazelcast.hibernate.LocalRegionFactorySlowTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 8.834 sec - in com.hazelcast.hibernate.LocalRegionFactorySlowTest
Running com.hazelcast.hibernate.CacheHitMissNonStrictTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.565 sec - in com.hazelcast.hibernate.CacheHitMissNonStrictTest
Running com.hazelcast.hibernate.access.ReadWriteAccessDelegateTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.014 sec - in com.hazelcast.hibernate.access.ReadWriteAccessDelegateTest
Running com.hazelcast.hibernate.CacheHitMissReadOnlyTest
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.009 sec - in com.hazelcast.hibernate.CacheHitMissReadOnlyTest
Running com.hazelcast.hibernate.serialization.ExpiryMarkerTest
Tests run: 10, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.004 sec - in com.hazelcast.hibernate.serialization.ExpiryMarkerTest
Running com.hazelcast.hibernate.LocalRegionFactoryDefaultTest
Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.974 sec - in com.hazelcast.hibernate.LocalRegionFactoryDefaultTest
Running com.hazelcast.hibernate.RegionFactoryDefaultSlowTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 78.765 sec - in com.hazelcast.hibernate.RegionFactoryDefaultSlowTest
Running com.hazelcast.hibernate.local.LocalRegionCacheTest
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.006 sec - in com.hazelcast.hibernate.local.LocalRegionCacheTest
Running com.hazelcast.hibernate.CacheHitMissReadWriteTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.49 sec - in com.hazelcast.hibernate.CacheHitMissReadWriteTest
Running com.hazelcast.hibernate.serialization.ValueTest
Tests run: 10, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.005 sec - in com.hazelcast.hibernate.serialization.ValueTest
Running com.hazelcast.hibernate.NativeClientTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.766 sec - in com.hazelcast.hibernate.NativeClientTest
Running com.hazelcast.hibernate.serialization.HibernateSerializationHookAvailableTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.097 sec - in com.hazelcast.hibernate.serialization.HibernateSerializationHookAvailableTest
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128M; support was removed in 8.0

Results :

Tests run: 115, Failures: 0, Errors: 0, Skipped: 4

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:40 min
[INFO] Finished at: 2016-09-29T01:48:41+02:00
[INFO] Final Memory: 29M/508M
[INFO] ------------------------------------------------------------------------

Process finished with exit code 0

@mesutcelik
Copy link
Contributor

This maven runtime

hazelcast-hibernate52 (hho-hibernate-52x)$ mvn -v
Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 11:22:22-0400)
Maven home: /usr/local/apache-maven/apache-maven-3.1.1
Java version: 1.7.0_51, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.11.6", arch: "x86_64", family: "mac"

this is the output:

hazelcast-hibernate52 (hho-hibernate-52x)$ mvn clean test
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building hazelcast-hibernate52 1.0.2-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ hazelcast-hibernate52 ---
[INFO] Deleting /Users/mesutcelik/hazelcast-development/hazelcast-hibernate5/hazelcast-hibernate52/target
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ hazelcast-hibernate52 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/mesutcelik/hazelcast-development/hazelcast-hibernate5/hazelcast-hibernate52/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ hazelcast-hibernate52 ---
[INFO] Compiling 4 source files to /Users/mesutcelik/hazelcast-development/hazelcast-hibernate5/hazelcast-hibernate52/target/classes
[INFO] 
[INFO] --- animal-sniffer-maven-plugin:1.14:check (source-java6-check) @ hazelcast-hibernate52 ---
[INFO] Checking unresolved references to org.codehaus.mojo.signature:java16:1.0
[INFO] 
[INFO] --- maven-bundle-plugin:2.3.7:manifest (bundle-manifest) @ hazelcast-hibernate52 ---
[WARNING] Manifest com.hazelcast:hazelcast-hibernate52:jar:1.0.2-SNAPSHOT : Did not find matching referal for !org.junit
[WARNING] Manifest com.hazelcast:hazelcast-hibernate52:jar:1.0.2-SNAPSHOT : Did not find matching referal for org.apache.log4j.*
[WARNING] Manifest com.hazelcast:hazelcast-hibernate52:jar:1.0.2-SNAPSHOT : Did not find matching referal for org.apache.logging.log4j.*
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ hazelcast-hibernate52 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 6 resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @ hazelcast-hibernate52 ---
[INFO] Compiling 30 source files to /Users/mesutcelik/hazelcast-development/hazelcast-hibernate5/hazelcast-hibernate52/target/test-classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /Users/mesutcelik/hazelcast-development/hazelcast-hibernate5/hazelcast-hibernate5/src/test/java/com/hazelcast/hibernate/RegionFactoryDefaultSlowTest.java:[61,107] error: cannot find symbol
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.158s
[INFO] Finished at: Wed Sep 28 20:28:11 EDT 2016
[INFO] Final Memory: 29M/723M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:testCompile (default-testCompile) on project hazelcast-hibernate52: Compilation failure
[ERROR] /Users/mesutcelik/hazelcast-development/hazelcast-hibernate5/hazelcast-hibernate5/src/test/java/com/hazelcast/hibernate/RegionFactoryDefaultSlowTest.java:[61,107] error: cannot find symbol
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
hazelcast-hibernate52 (hho-hibernate-52x)$ 

@hho
Copy link
Contributor Author

hho commented Sep 29, 2016

Hibernate 5.2 needs Java 8 – and SessionFactoryImpl.getQueryCache() is now a default method in an interface. That's why Java 7 can't find it.

Compiling with Java 8 is not an option? Target is set to 1.6 anyway, so backward compatibility is preserved. It's basically just the build environment that needs to be updated.

@mesutcelik
Copy link
Contributor

That was right. Sorry it was my bad. I switched to Java 8 and tests passed. Can you please update this in the readme with this restriction?
I also need to check the changes done but PR review won't be easy as we have just new files in another directory. Somehow i need to compare this 4 new files with the old ones to see what has changed.

In any case, that is already good to see existing tests are passing.

@devOpsHazelcast
Copy link
Contributor

Test FAILed.

@devOpsHazelcast
Copy link
Contributor

Test PASSed.

Copy link
Contributor

@emre-aydin emre-aydin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@mesutcelik
Copy link
Contributor

mesutcelik commented Oct 3, 2016

Hi @hho ,

Can you please sign our Contributor Agreement if not done yet ?
https://hazelcast.atlassian.net/wiki/display/COM/Hazelcast+Contributor+Agreement

👍 Can you please squash commits as well?

There are now separate modules for Hibernate 5.0.x and 5.1.x support
(hazelcast-hibernate5) and for 5.2.x support (hazelcast-hibernate52).

The project now needs to be built with Java 8. However, the 5.0/5.1
support still is compatible with Java 6+.
@hho
Copy link
Contributor Author

hho commented Oct 4, 2016

I signed the CLA right after opening this Pull Request. Enes has already put me on your Confluence page.

I also just squashed the commits into one.

@devOpsHazelcast
Copy link
Contributor

Test PASSed.

@mesutcelik mesutcelik merged commit 874ff39 into hazelcast:master Oct 4, 2016
@mesutcelik
Copy link
Contributor

many thanks for the contribution @hho ! 👏 👏

@thekalinga
Copy link

thekalinga commented Oct 9, 2016

The readme says hazelcast-hibernate52 supports hibernate 5.2, but I cannot find the mvn artifact for this release.

When are you planning on releasing hibernate 5.2 support?

http://central.maven.org/maven2/com/hazelcast/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

hibernate-5.2 support
6 participants