How to enable cache server JNDI lookup support in Coherence 12.2.1? - oracle

I am trying to access Coherence 12.2.1's cache (deployed in data tier) from application tier (deployed in application tier) that staying same Coherence cluster with different WebLogic clusters.
Oracle stated:
A component-scoped JNDI tree can be used in EJBs, servlets, or JSPs to reference the NamedCache.
To use a component-scoped JNDI lookup, define a resource-ref of type com.tangosol.net.NamedCache in either the web.xml or ejb-jar.xml file. Example 3-2 illustrates a <resource-ref> stanza that identifies myCache as the NamedCache.
in https://docs.oracle.com/cd/E24329_01/web.1211/e24442/coh_wls.htm#COHWL117
I developed a Coherence application and deploy it into local storage enabled WebLogic server (coherence managed server). I used Application Lifecycle Listener to access and initialise cache, it works fine.
I can find the cache was populate up in Coherence cache server by using VisualVM, please see attachment.
But unfortunately, I can't find any thing about the cache in my WebLogic managed server JNDI tree, Please find attachment.
I tried to find out a way to enable Coherence cache server (it was integrated into WebLogic 12c) support JNDI look up.
I found something like this:
<cache-config xmlns:jndi="class://com.oracle.coherence.environment.extensible.namespaces.JNDINamespaceContentHandler">
...
</cache-config>
But unfortunately again, com.oracle.coherence.environment.extensible.namespaces.JNDINamespaceContentHandler was removed from WebLogic 12c. Which means there is no way to enable Coherence data cache JNDI name configuration in Coherence 12cR2.
Any advice please!!

Were you able to create the ConnectionFactory, Outbound pools, etc ?
I suggest you take a look at this post here. It should help you out.
Hope it helps !!

Related

How can I achieve local caching using Spring boot?

I am trying to setup a spring boot application and looking for options to store the small data in the local cache and then this local cache interacts with Redis server which will be on google cloud platform. This local cache can be shared across multiple nodes. I see Redis pro can help to achieve this but that is not free. Is there any open source option I can use? Or any other way I can set this up in Spring boot? How can I set this local cache which syncs up with the central cache? Any suggestions please?
You can use Redisson https://github.com/redisson/redisson/wiki/14.-Integration-with-frameworks/#1421-spring-cache-local-cache-and-data-partitioning. It's available in the Pro version.
If you would like to implement it by yourself, you would need to implement custom CacheManager that first looks up entries in local cache (implemented likely with something smarter than a HashMap, like Caffeine, if entry not found goes to Redis based CacheManager and then depending on the result puts the data to Caffeine cache.
For storing data in Redis and making sure all nodes are in sync, you can use Redis Pub/Sub mechanism to notify each connected node to update local cache.
Spring Boot for Apache Geode (SBDG) offers client-side caching, or what is commonly referred to as "Near Caching". See here.
HISTORY
Apache Geode is an open source software (OSS), In-Memory Data Grid (IMDG) technology, having an Apache 2 License. Indeed, it can be much more than a cache if need be, but fits perfectly well in the caching use case, at any layer in the application architecture (Web, Service, Data).
The commercial version of Apache Geode is VMware Tanzu GemFire, built on Apache Geode source with support from VMware, if needed. But, to use Apache Geode, is completely free.
In fact, the original Spring Cache Abstraction was inspired by Costin Leau's development (original lead & creator) of Spring Data GemFire, which has been replaced by Spring Data for Apache Geode (SDG), to focus on the OSS offering. (See here/alt-here, then here, as well as from Boot).
SBDG is an extension of SDG to give users of Apache Geode (or alternatively, VMware Tanzu GemFire) a proper and first-class experience using Apache Geode in a Spring context, and specifically with Spring Boot features (e.g. auto-configuration). That is, SBDG is a special extension of Spring Boot catered specifically to Apache Geode to handle a variety of application concerns (like caching) that is owned and maintained by the Spring Team, itself.
SBDG is even capable of handling several caching patterns in addition to "Near Caching". See the topic of caching in general.
Finally, SBDG also includes Spring Session for Apache Geode (SSDG) to handle your Web, HTTP Session state caching concerns independent of you Web container (e.g. Tomcat) using Apache Geode as the caching provider for the HTTP Session state. It is, of course, built on Spring Session core (see here).

How to setup tree cache in tc server

I want to migrate an aplication which is currenty runnung in jboss 7 to tc server 2.9.6. In jboss we were using infinispan tree cache for caching. Is it possible to set up the same for tc server or I have to use any other caching techniques in tc server ?
Migrating projects from one container to another is often problematic. Not as much with Infinispan
This article(https://dzone.com/articles/how-configure-infinispan) is about configuring Infinispan, using Transaction Manager for demarcating transaction boundaries, while keeping the data both in a memory and relational database.

Accessing Coherence Cache hosted on Weblogic 12c from Java Client

I would like to access and manipulate Coherence Cache configured on a cluster defined with in WebLogic 12c as a GAR via API in an java application.
Though I can get a reference to cache via NamedCache API but am unable to get objects added to it via web logic JSP page.
Any tips will be appreciated
As long as you have the same cluster and cache configuration, all you have to do from your stand-alone Java process is to call into the CacheFactory class and ask for the cache.

enable hibernate app to use clustered hazelcast

our prod environment architecture is decided to be like this:
2 machines that each of them have 2 tomcat instances (on vm). there is spring web app with hibernate running on tomcat.
there are also 2 db instances distributed to both machines.
so, we think that hazelcast fits this achitecture well. hazelcast will be second level cache for hibernate, it will manage clustered cache over db instances.
we installed hibernate server and defined our clusters on it.
i've searched offical hazelcast doc and several sites but i couldnt find the way to configure hibernate to use this hazelcast server as L2 cache.
we dont want to change our existing app. we'll keep using hibernate as it is. is it possible? if so, how we can configure hazelcast server on our web app?
I think it is important to understand that your probably don't want to have a standalone Hazelcast cluster/server; what you normally do is to embed Hazelcast within your application.
Like Miko said, you can just enable Hazelcast to be used as second level cache; no need to make any fundamental changes.
I also don't understand what you mean with 'hibernate server', because Hibernate is just an OR mapper library and has no concept of server.
So can you tell a bit more what you want so we can help you out?

Does hibernate provide a datasource jdni url?

I know that application servers can typically provide a connection to your database via JNDI. Is it possible for hibernate running in Java SE to provide a JNDI url/datasource like an application container such as Tomcat/Glassfish/Jetty would normally?
From the documentation it seems like it should be possible. You just have to provide a few parameters:
Important Hibernate properties for JNDI datasources
hibernate.connection.datasource (required)
hibernate.jndi.url
hibernate.jndi.class
hibernate.connection.username
hibernate.connection.password

Resources