You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by monstereo <me...@gmail.com> on 2018/09/17 18:57:39 UTC

Do I need CacheStoreFactory class and hibernate configuration on Remote Node?

Simply hibernate example:

One node contains HibernateCacheStore and other configuration
(hibernate.cfg.xml vs...)
I have created that node and read database and write to cache (It works as
it is) (cache name is "hibernateCache")

Now I have created another node which has default configuration. Then in the
main app just contains::

public static void printCache(IgniteCache igniteCache){
        System.out.println("Print the all caches");
        Iterator<Cache.Entry&lt;Integer, Person>> cacheIterator =
igniteCache.iterator();
        while (cacheIterator.hasNext()){
            Cache.Entry cacheEntry = cacheIterator.next();
            System.out.println("Key: " + cacheEntry.getKey() + ", value:" +
cacheEntry.getValue());
        }
    }

public static void main...(){
       Ignite node = Ignition.start(defaultxmlpath)
        IgniteCache cache = node.getOrCreateCache("hibernateCache");
        System.out.println(cache.size());
        printCache(cache);
}

even if I work on local mode(and server nodes become 2 when I run the other
node), I can not see the cache size on the screen and does not print the
cache. It just waiting!!!


Note that: I have tried peer class loading false and true, but nothing
changed.



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Do I need CacheStoreFactory class and hibernate configuration on Remote Node?

Posted by Вячеслав Коптилин <sl...@gmail.com>.
Hello,

> Do I need CacheStoreFactory class and hibernate configuration on Remote
Node?
Yes, CacheStore classes must be in the classpath on all nodes (including
the client nodes)
For example, you can put them to '$IGNITE_HOME/libs' folder (a subfolder
can be created for convenience as well).

> Note that: I have tried peer class loading false and true, but nothing
changed.
Long story short, 'CacheStore' does not support zero deployment feature (it
is about Ignite Compute, in general)
Please take a look at this page:
https://apacheignite.readme.io/docs/zero-deployment

Thanks,
S.


пн, 17 сент. 2018 г. в 21:57, monstereo <me...@gmail.com>:

> Simply hibernate example:
>
> One node contains HibernateCacheStore and other configuration
> (hibernate.cfg.xml vs...)
> I have created that node and read database and write to cache (It works as
> it is) (cache name is "hibernateCache")
>
> Now I have created another node which has default configuration. Then in
> the
> main app just contains::
>
> public static void printCache(IgniteCache igniteCache){
>         System.out.println("Print the all caches");
>         Iterator<Cache.Entry&lt;Integer, Person>> cacheIterator =
> igniteCache.iterator();
>         while (cacheIterator.hasNext()){
>             Cache.Entry cacheEntry = cacheIterator.next();
>             System.out.println("Key: " + cacheEntry.getKey() + ", value:" +
> cacheEntry.getValue());
>         }
>     }
>
> public static void main...(){
>        Ignite node = Ignition.start(defaultxmlpath)
>         IgniteCache cache = node.getOrCreateCache("hibernateCache");
>         System.out.println(cache.size());
>         printCache(cache);
> }
>
> even if I work on local mode(and server nodes become 2 when I run the other
> node), I can not see the cache size on the screen and does not print the
> cache. It just waiting!!!
>
>
> Note that: I have tried peer class loading false and true, but nothing
> changed.
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>