Coder Social home page Coder Social logo

coherence-community / coherence-hibernate Goto Github PK

View Code? Open in Web Editor NEW
5.0 12.0 9.0 37.54 MB

Coherence Hibernate Project

Home Page: https://hibernate.coherence.community

License: Universal Permissive License v1.0

Java 99.60% CSS 0.40%
coherence hibernate cache java oracle-coherence

coherence-hibernate's Introduction

Welcome to the Oracle Coherence Hibernate Project

Build Status License Quality Gate Status GitHub release (latest by date) Chat with us on slack Stack Exchange questions Twitter Follow

The Oracle Coherence Hibernate project implements integration points between Oracle Coherence/Coherence CE and the Hibernate Object/Relational Mapping (ORM) framework.

Two primary integration points are covered currently:

Starting with Coherence Hibernate 3.x, we support Jakarta EE. Coherence Hibernate 2.x will continue to support Java EE.

Coherence Hibernate Java Coherence CE Hibernate Jakarta Git Branch/Tag

3.0.x

17

23.03

5.6, 6.x

main

2.3.x

11

22.06

4.3 - 5.6

2.3.x

Coherence Hibernate 3.0.2

Due to Hibernate Cache API changes, Coherence Hibernate 3.0.2 provides dedicated Maven modules targeting those Hibernate versions:

  • coherence-hibernate-cache-53 supports Hibernate 5.6.x

  • coherence-hibernate-cache-6 supports Hibernate 6.x

Coherence Hibernate 2.3.5

Due to Hibernate Cache API changes, Coherence Hibernate 2.3.5 provides dedicated Maven modules targeting those Hibernate versions:

  • coherence-hibernate-cache-4 supports Hibernate 4.3.x

  • coherence-hibernate-cache-5 supports Hibernate 5.0.x and 5.1.x

  • coherence-hibernate-cache-52 supports Hibernate 5.2.x

  • coherence-hibernate-cache-53 supports Hibernate 5.3.x, 5.4.x,5.5.x and 5.6.x

Documentation

Detailed project documentation is available on the Coherence Hibernate website. This includes the reference documentation as well as extensive JavaDoc for the Coherence Hibernate source code.

3.0.2

Website

API Doc.

3.0.3-SNAPSHOT

Website

API Doc.

2.3.5

Website

API Doc.

2.3.6-SNAPSHOT

Website

API Doc.

Note
The Apache Maven-based snapshots and releases for this project are published to Maven Central.

Supported Java & Coherence Versions

Coherence Hibernate Java Coherence CE Jakarta EE Git Branch/Tag

3.0.2

17

23.09.2

v3.0.2

3.0.3-SNAPSHOT

17

23.09.2

main

2.3.5

11

22.06.7

v2.3.5

2.3.6-SNAPSHOT

11

22.06.7

2.3.x

Supported Hibernate Versions

Hibernate Coherence Hibernate 2.3.x Coherence Hibernate 3.0.x

4.3.x

5.0

5.1

5.2

5.3

5.4

5.5

5.6

6.0

6.1

6.2

6.4

Samples

The reference documentation will also refer to various demo and sample applications. Those are part of this repository, and you can find those in the samples module.

Building from Source

Requirements

In order to build Coherence Hibernate (main branch), you need to have installed:

Check out sources

Check out the project using Git:

git clone https://github.com/coherence-community/coherence-hibernate.git
cd coherence-hibernate

Coherence Hibernate uses Apache Maven as build tool. You do not need to have Maven installed to build the project. Simply use the provided Maven Wrapper, e.g.:

  • Windows: mvnw.cmd clean package

  • Linux/Mac: ./mvnw clean package

Build the entire project

Build the entire project using Maven:

./mvnw clean package

Offline Builds

In case you are offline, and you run into issues building the project, e.g. the Coherence cluster as part of JUnit tests does not start up successfully, then you may have to provide additional command line arguments:

./mvnw clean package -DargLine="-Dcoherence.localhost=127.0.0.1 -Djava.net.preferIPv4Stack=true"

Build the project website

./mvnw clean install -pl coherence-hibernate-site

Deploy the project website

./mvnw deploy -pl coherence-hibernate-site

Getting Support

In case you have questions or if you run into issue using the Coherence Hibernate project, please feel free to reach out to us either via:

Both support channels are monitored by the project community.

Contributing

We would love to review your Pull requests. Please see the contributor guidelines for details.

License

Coherence Hibernate is Open Source software released under The Universal Permissive License (UPL), Version 1.0.

coherence-hibernate's People

Contributors

almubinsultan avatar brianoliver avatar dependabot[bot] avatar dhirupandey avatar ghillert avatar rstafford avatar thegridman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

coherence-hibernate's Issues

Hibernate 2.x - Add the ability to bootstrap a full Coherence Node with all default services

By default, Coherence Hibernate starts a minimal Coherence cluster node by default without starting any additional services. We should also provide an option to start Coherence using DefaultCacheServer, that way a fully feature Coherence Cluster node is started, allowing for the configuration of e.g. Management over REST, which would allow for the convenient introspection of the Cluster node and its caches using the Coherence CLI.

See also the chapter Starting Cache Servers Programmatically
in the reference guide.

Document Version Compatibility Matrix

Document a version compatibility matrix showing the compatibilities of various versions of Hibernate with various versions of Coherence and Coherence-based second-level cache SPI implementations. For each compatible combination, specify how to configure the Coherence-based SPI implementation.

Add license Files

Add whatever license files and banners are necessary for the licenses used in project.

Coherence-hibernate 5.2 seems to have issues with identity tokens for Coherence*Extend clients

Expected Behavior

The identity token introduction should work in a very similar way for the different coherence-hibernate versions.

The Coherence*Extend client introduces the identity token using the identity transformer, which then will be checked by the coherence cache server using the identity asserter.

Actual Behavior

Coherence-hibernate-cache-52 seems to have difficulties loading the value on the client side from the identity transformer.

Keeping the settings, but changing only the coherence-hibernate version to coherence-hibernate-cache-4 will result in successful identity token management.

The identity token manager implementation for client and server that I'm using can be found in this repository.

The related link to the Oracle documentation.

Coherence cache server version

Oracle Coherence CE 20.12

Coherence-hibernate versions

artifactId version status
coherence-hibernate-cache-4 2.0.0 working
coherence-hibernate-cache-52 2.0.0 issue occurs
coherence-hibernate-cache-52 2.0.1-SNAPSHOT issue occurs

Not tested with coherence-hibernate-cache-5!

Involved coherence cluster settings

Coherence*Extend client configuration part

   <security-config>
      <identity-transformer>
        <class-name>com.example.coherence.CoherenceTokenManagers.ClientSideTokenManager</class-name>
      </identity-transformer>
   </security-config>

Cache server configuration part

  <security-config>
    <identity-asserter>
      <class-name>com.example.coherence.CoherenceTokenManagers.ServerSideTokenManager</class-name>
    </identity-asserter>
  </security-config>

Debug Output

Coherence*Extend client debug output

Oracle Coherence Version 20.12 Build 83712
 Community Edition: Development mode
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

2021-04-12 14:11:26.219/13.456 Oracle Coherence CE 20.12 <Error> (thread=main, member=n/a): Failed to configure the Security module
2021-04-12 14:11:26.219/13.456 Oracle Coherence CE 20.12 <Error> (thread=main, member=n/a): 
(Wrapped: Unable to load class "com.example.coherence.CoherenceTokenManagers.ClientSideTokenManager" using null
<identity-transformer>
  <class-name>com.example.coherence.CoherenceTokenManagers.ClientSideTokenManager</class-name>
</identity-transformer>) java.lang.ClassNotFoundException: com.tangosol.net.security.IdentityTransformer
	at com.tangosol.util.Base.ensureRuntimeException(Base.java:251)
	at com.tangosol.run.xml.XmlHelper.createInstance(XmlHelper.java:2895)
	at com.tangosol.run.xml.XmlHelper.createInstance(XmlHelper.java:2779)
	at com.tangosol.internal.net.security.LegacyXmlSecurityHelper.fromXml(LegacyXmlSecurityHelper.java:55)
	at com.tangosol.internal.net.security.LegacyXmlStandardHelper.fromXml(LegacyXmlStandardHelper.java:43)
	at com.tangosol.coherence.component.net.Security.configureSecurity(Security.CDB:25)
	at com.tangosol.coherence.component.net.Security$ConfigAction.run(Security.CDB:3)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.tangosol.coherence.component.net.Security.getInstance(Security.CDB:5)
	at com.tangosol.coherence.component.net.Cluster.onStart(Cluster.CDB:28)
	at com.tangosol.coherence.component.net.Cluster.start(Cluster.CDB:12)
	at com.tangosol.coherence.component.util.SafeCluster.startCluster(SafeCluster.CDB:5)
	at com.tangosol.coherence.component.util.SafeCluster.restartCluster(SafeCluster.CDB:10)
	at com.tangosol.coherence.component.util.SafeCluster.ensureRunningCluster(SafeCluster.CDB:32)
	at com.tangosol.coherence.component.util.SafeCluster.getRunningCluster(SafeCluster.CDB:7)
	at com.tangosol.coherence.component.util.SafeCluster.start(SafeCluster.CDB:5)
	at com.tangosol.net.CacheFactory.ensureCluster(CacheFactory.java:589)
	at com.oracle.coherence.hibernate.cache.CoherenceRegionFactory.start(CoherenceRegionFactory.java:190)
	at org.hibernate.cache.spi.RegionFactory.start(RegionFactory.java:63)
	at org.hibernate.internal.CacheImpl.<init>(CacheImpl.java:71)
	at org.hibernate.engine.spi.CacheInitiator.initiateService(CacheInitiator.java:28)
	at org.hibernate.engine.spi.CacheInitiator.initiateService(CacheInitiator.java:20)
	at org.hibernate.service.internal.SessionFactoryServiceRegistryImpl.initiateService(SessionFactoryServiceRegistryImpl.java:59)
	at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:259)
	at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:233)
	at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:210)
	at org.hibernate.service.internal.SessionFactoryServiceRegistryImpl.getService(SessionFactoryServiceRegistryImpl.java:80)
	at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:243)
	at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:462)
	at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:892)
	at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:57)
	at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365)
	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:390)
	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:377)
	at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:341)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1758)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1695)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:573)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:495)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
	at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1089)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:859)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:780)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:412)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:333)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1277)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1265)
	at com.example.coherence.CoherenceApplication.main(CoherenceApplication.java:13)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
	at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
	at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
	at org.springframework.boot.loader.PropertiesLauncher.main(PropertiesLauncher.java:593)
Caused by: java.lang.NoClassDefFoundError: com/tangosol/net/security/IdentityTransformer
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:405)
	at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:93)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:348)
	at com.tangosol.util.ExternalizableHelper.loadClass(ExternalizableHelper.java:3740)
	at com.tangosol.run.xml.XmlHelper.createInstance(XmlHelper.java:2853)
	... 59 more
Caused by: java.lang.ClassNotFoundException: com.tangosol.net.security.IdentityTransformer
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
	... 77 more

Cache server debug output

2021-04-12 14:37:59.298/398.545 Oracle Coherence CE 20.12 <Warning> (thread=Proxy:ExtendTcpCacheService:TcpAcceptor, member=3): An exception occurred while processing the identity token: java.lang.SecurityException: Access denied
2021-04-12 14:37:59.427/398.673 Oracle Coherence CE 20.12 <D6> (thread=Proxy:ExtendTcpCacheService:TcpAcceptor:TcpProcessor, member=3): Released: TcpConnection(Id=0x00000178C616B2010A644DEDC656E65D18D8049630B1778ECC741F6D607C9B8A, Open=false, Member(Id=1, Timestamp=2021-04-12 14:37:54.329, Address=XXX.XXX.XXX.XXX:9000, MachineId=59023, Location=site:k8s-ims-b,rack:AD-B,machine:coherence-test-client-deployment-84db96fd88-s748g,process:coherence-cache-process,member:coherence-cache-thread, Role=CoherenceClient), LocalAddress=XXX.XXX.XXX.XXX:9000, RemoteAddress=XXX.XXX.XXX.XXX:50360)

Steps to reproduce

  1. Start the Coherence cache server configured to have security-config
  2. Start the Coherence*Extend client configured to have security-config and the start up will fail.

Allow remote sample to work with TCMP being disabled

We have areas in the code where we use CacheFactory.ensureCluster() which does not work with TCMP being disabled (by setting system property coherence.tcmp.enabled to false. You will get an exception java.lang.UnsupportedOperationException: TCMP clustering has been disabled; this configuration may only access clustered services via Extend proxies.

Could not find artifact com.oracle.coherence:coherence:jar:12.1.2-0-0 in central

Hello there,

I am trying to use the coherence-hibernate-second-level-cache in my project:

        <dependency>
            <groupId>com.oracle.coherence.hibernate</groupId>
            <artifactId>coherence-hibernate-second-level-cache</artifactId>
            <version>1.0.0</version>
        </dependency>

However when I try to package it I get: Could not find artifact com.oracle.coherence:coherence:jar:12.1.2-0-0 in central (https://repo.maven.apache.org/maven2)

I've been looking for that version but I did not find it anywhere (oracle downloads, maven central, mvnrepository.com...). In Oracle downloads I found the installer [1], but if I have to install, extract the coherence jar and add it manually to my repo, uf...

Any thoughts on this?

Thanks in advance,

Luis

[1] http://download.oracle.com/otn/nt/middleware/12c/12212/fmw_12.2.1.2.0_coherence_Disk1_1of1.zip

Implement POF Serialization if Feasible

Investigate whether it is feasible to implement POF serialization and, if so, implement it. The objects in the cache value object graphs should all be of classes in the project codebase or Hibernate codebase, not of Hibernate user classes. However investigation is needed as to whether it is possible for Hibernate users to supply arbitrary VersionComparators.

Fix intermittent test failure in ReadWriteCoherenceRegionAccessStrategyTest

We see the following intermittent test failure:

ReadWriteCoherenceRegionAccessStrategyTest.testPutFromLoadEntryPresentNotMinimalPutsLocksReleased:175 Expect successful putFromLoad when entry present and not minimal puts and locks released

See: https://github.com/coherence-community/coherence-hibernate/blob/master/coherence-hibernate-cache-4/src/test/java/com/oracle/coherence/hibernate/cache/access/ReadWriteCoherenceRegionAccessStrategyTest.java#L160

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.