You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by dstieglitz <ds...@stainlesscode.com> on 2015/07/13 18:24:45 UTC
Documentation on configuring L2 cache programatically
Hello:
I'm interested in configuring a distributed Hibernate L2 cache
programmatically as documented on this page:
http://apacheignite.gridgain.org/v1.0/docs/hibernate-l2-cache
without using the Ignition.start() method, rather, configuring the cache
after the node has been started. Is this possible? Is it just a matter of
configuring caches having names that match the Hibernate entity regions?
Dan
--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Documentation-on-configuring-L2-cache-programatically-tp640.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.
Re: Documentation on configuring L2 cache programatically
Posted by dstieglitz <ds...@stainlesscode.com>.
Thanks Val. One last question:
How can I get a list of programmatically created caches from the system?
I've tried "ignite.configuration().cacheConfiguration" but I think that
returns a set of cache configurations, not created caches? Is that correct?
Dan
--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Documentation-on-configuring-L2-cache-programatically-tp640p662.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.
Re: Documentation on configuring L2 cache programatically
Posted by vkulichenko <va...@gmail.com>.
Dan,
Got it. You can use configuration from documentation, but specify it in code
instead of XML. Each cache name should correspond to L2 cache region name
(either a full class name or a full association name).
-Val
--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Documentation-on-configuring-L2-cache-programatically-tp640p643.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.
Re: Documentation on configuring L2 cache programatically
Posted by dstieglitz <ds...@stainlesscode.com>.
Let me explain the scenario a bit more: I've written a Grails plugin for
Ignite (http://github.com/dstieglitz/grails-ignite). During application
startup there is no application context XML file, it is created dynamically
using a Groovy DSL. Additionally, each domain object cache will be created
programmatically using meta programming techniques; e.g., query all domain
object names, cache configuration options, and then create caches.
We will still be starting Ignite I just need to be able to create the
caches via spring configuration or by running some code after the node is
started to configure the caches.
Each node will be a client and remote server node to the rest of the
cluster. The scenario I need is:
1. Create Ignite configuration using Groovy DSL
2. Start ignite using Ignition.start() method on each node
3. Interrogate domain class names, create CacheConfiguration objects
4. Create caches using Ignite.createCache()
5. Initialize Hibernate session factory
What specific configuration should be provided in step 4 to ensure the
caches are used for Hibernate?
Dan
On Mon, Jul 13, 2015 at 5:10 PM, vkulichenko [via Apache Ignite Users] <
ml-node+s70518n641h95@n6.nabble.com> wrote:
> Hi Dan,
>
> You can start caches dynamically after the nodes are started (just provide
> proper configuration to Ignite.createCache() method). But I'm not sure how
> you're going to live without Ignition.start(). You need an embedded node
> (probably client) anyway.
>
> E.g., this scenario will work:
> - Start remote server nodes (optional).
> - Start your application and use Ignition.start() to start an embedded
> client.
> - Dynamically start all required caches using Ignite.createCache()
> method.
> - Initialize Hibernate session factory.
>
> When starting nodes you can use configuration that doesn't have caches.
>
> Does this work for you?
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://apache-ignite-users.70518.x6.nabble.com/Documentation-on-configuring-L2-cache-programatically-tp640p641.html
> To unsubscribe from Documentation on configuring L2 cache
> programatically, click here
> <http://apache-ignite-users.70518.x6.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=640&code=ZHN0aWVnbGl0ekBzdGFpbmxlc3Njb2RlLmNvbXw2NDB8LTIwMTg4ODc0Nw==>
> .
> NAML
> <http://apache-ignite-users.70518.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Documentation-on-configuring-L2-cache-programatically-tp640p642.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.
Re: Documentation on configuring L2 cache programatically
Posted by vkulichenko <va...@gmail.com>.
Hi Dan,
You can start caches dynamically after the nodes are started (just provide
proper configuration to Ignite.createCache() method). But I'm not sure how
you're going to live without Ignition.start(). You need an embedded node
(probably client) anyway.
E.g., this scenario will work:
- Start remote server nodes (optional).
- Start your application and use Ignition.start() to start an embedded
client.
- Dynamically start all required caches using Ignite.createCache() method.
- Initialize Hibernate session factory.
When starting nodes you can use configuration that doesn't have caches.
Does this work for you?
--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Documentation-on-configuring-L2-cache-programatically-tp640p641.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.