Hibernate L2 cache with Ignite. How?

classic Classic list List threaded Threaded
20 messages Options
monstereo monstereo
Reply | Threaded
Open this post in threaded view
|

Hibernate L2 cache with Ignite. How?

Even I am using apache ignite documentation or High Performance In-Memory
computing book,
I could not understand.

I have created simple cache with ignite (using postgresql) (implementing
CacheStoreAdapter vs...)
Also I have created simple hibernate project (gets data from database,
update vs...)

But I can not combine them.

*Could someone explain the job step by step ?*
(In High Performance In-Memory computing book -> all xml configuration in a
file which I could not handle at all, if possible, I want to create all the
xml file seperately)

thanks,




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
ezhuravlev ezhuravlev
Reply | Threaded
Open this post in threaded view
|

Re: Hibernate L2 cache with Ignite. How?

Looks like you read a wrong documentation, for Hibernate L2 cache you don't even need to implement CacheStoreAdapter - it's needed only for using 3rd party db as a Cache Store. Here is the right documentation for using Ignite as L2 Hibernate cache: https://apacheignite-mix.readme.io/docs/hibernate-l2-cache


Evgenii

2018-07-10 15:59 GMT+03:00 monstereo <[hidden email]>:
Even I am using apache ignite documentation or High Performance In-Memory
computing book,
I could not understand.

I have created simple cache with ignite (using postgresql) (implementing
CacheStoreAdapter vs...)
Also I have created simple hibernate project (gets data from database,
update vs...)

But I can not combine them.

*Could someone explain the job step by step ?*
(In High Performance In-Memory computing book -> all xml configuration in a
file which I could not handle at all, if possible, I want to create all the
xml file seperately)

thanks,




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

monstereo monstereo
Reply | Threaded
Open this post in threaded view
|

Re: Hibernate L2 cache with Ignite. How?

Thanks.
I have seen this document before.
However, I could not understand how datas are loading ignite cache(s)?
Can you explain what is going on this .java class?



ezhuravlev wrote

> Looks like you read a wrong documentation, for Hibernate L2 cache you
> don't
> even need to implement CacheStoreAdapter - it's needed only for using 3rd
> party db as a Cache Store. Here is the right documentation for using
> Ignite
> as L2 Hibernate cache:
> https://apacheignite-mix.readme.io/docs/hibernate-l2-cache
>
> Also, here is the working example:
> https://github.com/apache/ignite/blob/master/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExample.java
>
> Evgenii
>
> 2018-07-10 15:59 GMT+03:00 monstereo &lt;

> mehmetozanguven@

> &gt;:
>
>> Even I am using apache ignite documentation or High Performance In-Memory
>> computing book,
>> I could not understand.
>>
>> I have created simple cache with ignite (using postgresql) (implementing
>> CacheStoreAdapter vs...)
>> Also I have created simple hibernate project (gets data from database,
>> update vs...)
>>
>> But I can not combine them.
>>
>> *Could someone explain the job step by step ?*
>> (In High Performance In-Memory computing book -> all xml configuration in
>> a
>> file which I could not handle at all, if possible, I want to create all
>> the
>> xml file seperately)
>>
>> thanks,
>>
>>
>>
>>
>> --
>> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>>





--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
ilya.kasnacheev ilya.kasnacheev
Reply | Threaded
Open this post in threaded view
|

Re: Hibernate L2 cache with Ignite. How?

Hello!

From the comments of Java file linked:

* When running example, it's easy to notice that when an object is first
* put into a database, the L2 cache is not used and it's contents is empty.
* However, when an object is first read from the database, it is immediately
* stored in L2 cache (which is Ignite In-Memory Data Ignite cluster in fact), which can
* be seen in stats output. Further requests of the same object only read the data
* from L2 cache and do not hit the database.

Regards,

--
Ilya Kasnacheev

2018-07-10 16:23 GMT+03:00 monstereo <[hidden email]>:
Thanks.
I have seen this document before.
However, I could not understand how datas are loading ignite cache(s)?
Can you explain what is going on this .java class?



ezhuravlev wrote
> Looks like you read a wrong documentation, for Hibernate L2 cache you
> don't
> even need to implement CacheStoreAdapter - it's needed only for using 3rd
> party db as a Cache Store. Here is the right documentation for using
> Ignite
> as L2 Hibernate cache:
> https://apacheignite-mix.readme.io/docs/hibernate-l2-cache
>
> Also, here is the working example:
> https://github.com/apache/ignite/blob/master/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExample.java
>
> Evgenii
>
> 2018-07-10 15:59 GMT+03:00 monstereo &lt;

> mehmetozanguven@

> &gt;:
>
>> Even I am using apache ignite documentation or High Performance In-Memory
>> computing book,
>> I could not understand.
>>
>> I have created simple cache with ignite (using postgresql) (implementing
>> CacheStoreAdapter vs...)
>> Also I have created simple hibernate project (gets data from database,
>> update vs...)
>>
>> But I can not combine them.
>>
>> *Could someone explain the job step by step ?*
>> (In High Performance In-Memory computing book -> all xml configuration in
>> a
>> file which I could not handle at all, if possible, I want to create all
>> the
>> xml file seperately)
>>
>> thanks,
>>
>>
>>
>>
>> --
>> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>>





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

monstereo monstereo
Reply | Threaded
Open this post in threaded view
|

Re: Hibernate L2 cache with Ignite. How?

thanks,
then in hibernate l2 cache, we do not provide the specific data to load
cache?(igniteCache.loadCache() )
but then, how many data will be in l2 cache, can I limit this space?


ilya.kasnacheev wrote

> Hello!
>
> From the comments of Java file linked:
>
> * When running example, it's easy to notice that when an object is first
> * put into a database, the L2 cache is not used and it's contents is
> empty.
> * However, *when an object is first read from the database, it is
> immediately*
> * *stored in L2 cache (which is Ignite In-Memory Data Ignite cluster in
> fact)*, which can
> * be seen in stats output. Further requests of the same object only read
> the data
> * from L2 cache and do not hit the database.
>
> Regards,
>
> --
> Ilya Kasnacheev
>
> 2018-07-10 16:23 GMT+03:00 monstereo &lt;

> mehmetozanguven@

> &gt;:
>
>> Thanks.
>> I have seen this document before.
>> However, I could not understand how datas are loading ignite cache(s)?
>> Can you explain what is going on this .java class?
>>
>>
>>
>> ezhuravlev wrote
>> > Looks like you read a wrong documentation, for Hibernate L2 cache you
>> > don't
>> > even need to implement CacheStoreAdapter - it's needed only for using
>> 3rd
>> > party db as a Cache Store. Here is the right documentation for using
>> > Ignite
>> > as L2 Hibernate cache:
>> > https://apacheignite-mix.readme.io/docs/hibernate-l2-cache
>> >
>> > Also, here is the working example:
>> > https://github.com/apache/ignite/blob/master/examples/
>> src/main/java-lgpl/org/apache/ignite/examples/datagrid/hibernate/
>> HibernateL2CacheExample.java
>> >
>> > Evgenii
>> >
>> > 2018-07-10 15:59 GMT+03:00 monstereo &lt;
>>
>> > mehmetozanguven@
>>
>> > &gt;:
>> >
>> >> Even I am using apache ignite documentation or High Performance
>> In-Memory
>> >> computing book,
>> >> I could not understand.
>> >>
>> >> I have created simple cache with ignite (using postgresql)
>> (implementing
>> >> CacheStoreAdapter vs...)
>> >> Also I have created simple hibernate project (gets data from database,
>> >> update vs...)
>> >>
>> >> But I can not combine them.
>> >>
>> >> *Could someone explain the job step by step ?*
>> >> (In High Performance In-Memory computing book -> all xml configuration
>> in
>> >> a
>> >> file which I could not handle at all, if possible, I want to create
>> all
>> >> the
>> >> xml file seperately)
>> >>
>> >> thanks,
>> >>
>> >>
>> >>
>> >>
>> >> --
>> >> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>> >>
>>
>>
>>
>>
>>
>> --
>> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>>





--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
ezhuravlev ezhuravlev
Reply | Threaded
Open this post in threaded view
|

Re: Hibernate L2 cache with Ignite. How?

Well, you can use, for example, eviction policy: https://apacheignite.readme.io/docs/evictions

Evgenii

2018-07-10 16:43 GMT+03:00 monstereo <[hidden email]>:
thanks,
then in hibernate l2 cache, we do not provide the specific data to load
cache?(igniteCache.loadCache() )
but then, how many data will be in l2 cache, can I limit this space?


ilya.kasnacheev wrote
> Hello!
>
> From the comments of Java file linked:
>
> * When running example, it's easy to notice that when an object is first
> * put into a database, the L2 cache is not used and it's contents is
> empty.
> * However, *when an object is first read from the database, it is
> immediately*
> * *stored in L2 cache (which is Ignite In-Memory Data Ignite cluster in
> fact)*, which can
> * be seen in stats output. Further requests of the same object only read
> the data
> * from L2 cache and do not hit the database.
>
> Regards,
>
> --
> Ilya Kasnacheev
>
> 2018-07-10 16:23 GMT+03:00 monstereo &lt;

> mehmetozanguven@

> &gt;:
>
>> Thanks.
>> I have seen this document before.
>> However, I could not understand how datas are loading ignite cache(s)?
>> Can you explain what is going on this .java class?
>>
>>
>>
>> ezhuravlev wrote
>> > Looks like you read a wrong documentation, for Hibernate L2 cache you
>> > don't
>> > even need to implement CacheStoreAdapter - it's needed only for using
>> 3rd
>> > party db as a Cache Store. Here is the right documentation for using
>> > Ignite
>> > as L2 Hibernate cache:
>> > https://apacheignite-mix.readme.io/docs/hibernate-l2-cache
>> >
>> > Also, here is the working example:
>> > https://github.com/apache/ignite/blob/master/examples/
>> src/main/java-lgpl/org/apache/ignite/examples/datagrid/hibernate/
>> HibernateL2CacheExample.java
>> >
>> > Evgenii
>> >
>> > 2018-07-10 15:59 GMT+03:00 monstereo &lt;
>>
>> > mehmetozanguven@
>>
>> > &gt;:
>> >
>> >> Even I am using apache ignite documentation or High Performance
>> In-Memory
>> >> computing book,
>> >> I could not understand.
>> >>
>> >> I have created simple cache with ignite (using postgresql)
>> (implementing
>> >> CacheStoreAdapter vs...)
>> >> Also I have created simple hibernate project (gets data from database,
>> >> update vs...)
>> >>
>> >> But I can not combine them.
>> >>
>> >> *Could someone explain the job step by step ?*
>> >> (In High Performance In-Memory computing book -> all xml configuration
>> in
>> >> a
>> >> file which I could not handle at all, if possible, I want to create
>> all
>> >> the
>> >> xml file seperately)
>> >>
>> >> thanks,
>> >>
>> >>
>> >>
>> >>
>> >> --
>> >> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>> >>
>>
>>
>>
>>
>>
>> --
>> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>>





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

monstereo monstereo
Reply | Threaded
Open this post in threaded view
|

Re: Hibernate L2 cache with Ignite. How?

This post was updated on .
I have create what apache ignite is said, but i got this exception:

Exception in thread "main" org.hibernate.service.spi.ServiceException:
Unable to create requested service [org.hibernate.cache.spi.RegionFactory]

Unable to resolve name
[org.apache.ignite.cache.hibernate.HibernateRegionFactory] as strategy
[org.hibernate.cache.spi.RegionFactory]



here is the dependencies that i am using:

<dependencies>
        <dependency>
            <groupId>org.apache.ignite</groupId>
            <artifactId>ignite-hibernate</artifactId>
            <version>1.2.0-incubating</version>
        </dependency>
        <dependency>
            <groupId>org.apache.ignite</groupId>
            <artifactId>ignite-core</artifactId>
            <version>2.5.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.ignite</groupId>
            <artifactId>ignite-spring</artifactId>
            <version>2.5.0</version>
        </dependency>
        <dependency>
            <groupId>postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <version>9.1-901-1.jdbc4</version>
        </dependency>
       
        <dependency>
            <groupId>org.apache.ignite</groupId>
            <artifactId>ignite-examples</artifactId>
            <version>1.0.0-RC3</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>5.3.2.Final</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-annotations</artifactId>
            <version>3.5.6-Final</version>
        </dependency>





--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
ezhuravlev wrote
Well, you can use, for example, eviction policy:
https://apacheignite.readme.io/docs/evictions

Evgenii

2018-07-10 16:43 GMT+03:00 monstereo <[hidden email]>:

> thanks,
> then in hibernate l2 cache, we do not provide the specific data to load
> cache?(igniteCache.loadCache() )
> but then, how many data will be in l2 cache, can I limit this space?
>
>
> ilya.kasnacheev wrote
> > Hello!
> >
> > From the comments of Java file linked:
> >
> > * When running example, it's easy to notice that when an object is first
> > * put into a database, the L2 cache is not used and it's contents is
> > empty.
> > * However, *when an object is first read from the database, it is
> > immediately*
> > * *stored in L2 cache (which is Ignite In-Memory Data Ignite cluster in
> > fact)*, which can
> > * be seen in stats output. Further requests of the same object only read
> > the data
> > * from L2 cache and do not hit the database.
> >
> > Regards,
> >
> > --
> > Ilya Kasnacheev
> >
> > 2018-07-10 16:23 GMT+03:00 monstereo <
>
> > mehmetozanguven@
>
> > >:
> >
> >> Thanks.
> >> I have seen this document before.
> >> However, I could not understand how datas are loading ignite cache(s)?
> >> Can you explain what is going on this .java class?
> >>
> >>
> >>
> >> ezhuravlev wrote
> >> > Looks like you read a wrong documentation, for Hibernate L2 cache you
> >> > don't
> >> > even need to implement CacheStoreAdapter - it's needed only for using
> >> 3rd
> >> > party db as a Cache Store. Here is the right documentation for using
> >> > Ignite
> >> > as L2 Hibernate cache:
> >> > https://apacheignite-mix.readme.io/docs/hibernate-l2-cache
> >> >
> >> > Also, here is the working example:
> >> > https://github.com/apache/ignite/blob/master/examples/
> >> src/main/java-lgpl/org/apache/ignite/examples/datagrid/hibernate/
> >> HibernateL2CacheExample.java
> >> >
> >> > Evgenii
> >> >
> >> > 2018-07-10 15:59 GMT+03:00 monstereo <
> >>
> >> > mehmetozanguven@
> >>
> >> > >:
> >> >
> >> >> Even I am using apache ignite documentation or High Performance
> >> In-Memory
> >> >> computing book,
> >> >> I could not understand.
> >> >>
> >> >> I have created simple cache with ignite (using postgresql)
> >> (implementing
> >> >> CacheStoreAdapter vs...)
> >> >> Also I have created simple hibernate project (gets data from
> database,
> >> >> update vs...)
> >> >>
> >> >> But I can not combine them.
> >> >>
> >> >> *Could someone explain the job step by step ?*
> >> >> (In High Performance In-Memory computing book -> all xml
> configuration
> >> in
> >> >> a
> >> >> file which I could not handle at all, if possible, I want to create
> >> all
> >> >> the
> >> >> xml file seperately)
> >> >>
> >> >> thanks,
> >> >>
> >> >>
> >> >>
> >> >>
> >> >> --
> >> >> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
> >> >>
> >>
> >>
> >>
> >>
> >>
> >> --
> >> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
> >>
>
>
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>
ezhuravlev ezhuravlev
Reply | Threaded
Open this post in threaded view
|

Re: Hibernate L2 cache with Ignite. How?

Hibernate is LGPL-licensed, so we stopped deploying there. To get artifacts for 2.5 version that have LGPL dependencies, you need to build them from the source [1] and deploy in your local repo. 

[1] http://ignite.apache.org/download.cgi#build-source

2018-07-10 21:46 GMT+03:00 monstereo <[hidden email]>:
I have create what apache ignite is said, but i got this exception:

Exception in thread "main" org.hibernate.service.spi.ServiceException:
Unable to create requested service [org.hibernate.cache.spi.RegionFactory]

Unable to resolve name
[org.apache.ignite.cache.hibernate.HibernateRegionFactory] as strategy
[org.hibernate.cache.spi.RegionFactory]



here is the dependencies that i am using:

<dependencies>
        <dependency>
            <groupId>org.apache.ignite</groupId>
            <artifactId>ignite-hibernate</artifactId>
            <version>1.2.0-incubating</version>
        </dependency>
        <dependency>
            <groupId>org.apache.ignite</groupId>
            <artifactId>ignite-core</artifactId>
            <version>2.5.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.ignite</groupId>
            <artifactId>ignite-spring</artifactId>
            <version>2.5.0</version>
        </dependency>
        <dependency>
            <groupId>postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <version>9.1-901-1.jdbc4</version>
        </dependency>

        <dependency>
            <groupId>org.apache.ignite</groupId>
            <artifactId>ignite-examples</artifactId>
            <version>1.0.0-RC3</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>5.3.2.Final</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-annotations</artifactId>
            <version>3.5.6-Final</version>
        </dependency>

monstereo monstereo
Reply | Threaded
Open this post in threaded view
|

Re: Hibernate L2 cache with Ignite. How?

I'm confused how to use these jar. I have the run the command "$ mvn clean
package -DskipTests -Prelease,lgpl"

and many things have been done successfully ignite-aws,
ignite-hibernate-core vs....

now how i am going to use them:

I have added them directly but given me the same error, here is the
dependencies
<dependencies>
        <dependency>
            <groupId>org.apache.ignite</groupId>
            <artifactId>ignite-core</artifactId>
            <version>2.5.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.ignite</groupId>
            <artifactId>ignite-spring</artifactId>
            <version>2.5.0</version>
        </dependency>


        <dependency>
            <groupId>org.apache.ignite</groupId>
            <artifactId>ignite-hibernate-core</artifactId>
            <version>2.5.0</version>
        </dependency>


        <dependency>
            <groupId>postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <version>9.1-901-1.jdbc4</version>
        </dependency>
        <dependency>
            <groupId>org.apache.ignite</groupId>
            <artifactId>ignite-examples</artifactId>
            <version>2.5.0</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>5.3.2.Final</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-annotations</artifactId>
            <version>3.5.6-Final</version>
        </dependency>

    </dependencies>




ezhuravlev wrote
> Hibernate is LGPL-licensed, so we stopped deploying there. To get
> artifacts
> for 2.5 version that have LGPL dependencies, you need to build them from
> the source [1] and deploy in your local repo.
>
> [1] http://ignite.apache.org/download.cgi#build-source
>
> 2018-07-10 21:46 GMT+03:00 monstereo &lt;

> mehmetozanguven@

> &gt;:
>
>> I have create what apache ignite is said, but i got this exception:
>>
>> Exception in thread "main" org.hibernate.service.spi.ServiceException:
>> Unable to create requested service
>> [org.hibernate.cache.spi.RegionFactory]
>>
>> Unable to resolve name
>> [org.apache.ignite.cache.hibernate.HibernateRegionFactory] as strategy
>> [org.hibernate.cache.spi.RegionFactory]
>>
>>
>>
>> here is the dependencies that i am using:
>>
>>
> <dependencies>
>>        
> <dependency>
>>            
> <groupId>
> org.apache.ignite
> </groupId>
>>            
> <artifactId>
> ignite-hibernate
> </artifactId>
>>            
> <version>
> 1.2.0-incubating
> </version>
>>        
> </dependency>
>>        
> <dependency>
>>            
> <groupId>
> org.apache.ignite
> </groupId>
>>            
> <artifactId>
> ignite-core
> </artifactId>
>>            
> <version>
> 2.5.0
> </version>
>>        
> </dependency>
>>        
> <dependency>
>>            
> <groupId>
> org.apache.ignite
> </groupId>
>>            
> <artifactId>
> ignite-spring
> </artifactId>
>>            
> <version>
> 2.5.0
> </version>
>>        
> </dependency>
>>        
> <dependency>
>>            
> <groupId>
> postgresql
> </groupId>
>>            
> <artifactId>
> postgresql
> </artifactId>
>>            
> <version>
> 9.1-901-1.jdbc4
> </version>
>>        
> </dependency>
>>
>>        
> <dependency>
>>            
> <groupId>
> org.apache.ignite
> </groupId>
>>            
> <artifactId>
> ignite-examples
> </artifactId>
>>            
> <version>
> 1.0.0-RC3
> </version>
>>        
> </dependency>
>>        
> <dependency>
>>            
> <groupId>
> org.hibernate
> </groupId>
>>            
> <artifactId>
> hibernate-core
> </artifactId>
>>            
> <version>
> 5.3.2.Final
> </version>
>>        
> </dependency>
>>        
> <dependency>
>>            
> <groupId>
> org.hibernate
> </groupId>
>>            
> <artifactId>
> hibernate-annotations
> </artifactId>
>>            
> <version>
> 3.5.6-Final
> </version>
>>        
> </dependency>
>>
>>
>>
>> --
>> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>>





--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
monstereo monstereo
Reply | Threaded
Open this post in threaded view
|

Re: Hibernate L2 cache with Ignite. How?

In reply to this post by ezhuravlev
Ignite github address says that "Required libs will appear at
/target/release-package/libs/optional subfolders."

When I go to that library, I can not see ignite-hibernate or something like
that.
Here is the my path:
/Desktop/ApacheIgniteSourceFolder/apache-ignite-2.5.0-src/target/release-package-fabric/libs/optional


ezhuravlev wrote
> Hibernate is LGPL-licensed, so we stopped deploying there. To get
> artifacts
> for 2.5 version that have LGPL dependencies, you need to build them from
> the source [1] and deploy in your local repo.
>
> [1] http://ignite.apache.org/download.cgi#build-source
>
> 2018-07-10 21:46 GMT+03:00 monstereo &lt;

> mehmetozanguven@

> &gt;:
>
>> I have create what apache ignite is said, but i got this exception:
>>
>> Exception in thread "main" org.hibernate.service.spi.ServiceException:
>> Unable to create requested service
>> [org.hibernate.cache.spi.RegionFactory]
>>
>> Unable to resolve name
>> [org.apache.ignite.cache.hibernate.HibernateRegionFactory] as strategy
>> [org.hibernate.cache.spi.RegionFactory]
>>
>>
>>
>> here is the dependencies that i am using:
>>
>>
> <dependencies>
>>        
> <dependency>
>>            
> <groupId>
> org.apache.ignite
> </groupId>
>>            
> <artifactId>
> ignite-hibernate
> </artifactId>
>>            
> <version>
> 1.2.0-incubating
> </version>
>>        
> </dependency>
>>        
> <dependency>
>>            
> <groupId>
> org.apache.ignite
> </groupId>
>>            
> <artifactId>
> ignite-core
> </artifactId>
>>            
> <version>
> 2.5.0
> </version>
>>        
> </dependency>
>>        
> <dependency>
>>            
> <groupId>
> org.apache.ignite
> </groupId>
>>            
> <artifactId>
> ignite-spring
> </artifactId>
>>            
> <version>
> 2.5.0
> </version>
>>        
> </dependency>
>>        
> <dependency>
>>            
> <groupId>
> postgresql
> </groupId>
>>            
> <artifactId>
> postgresql
> </artifactId>
>>            
> <version>
> 9.1-901-1.jdbc4
> </version>
>>        
> </dependency>
>>
>>        
> <dependency>
>>            
> <groupId>
> org.apache.ignite
> </groupId>
>>            
> <artifactId>
> ignite-examples
> </artifactId>
>>            
> <version>
> 1.0.0-RC3
> </version>
>>        
> </dependency>
>>        
> <dependency>
>>            
> <groupId>
> org.hibernate
> </groupId>
>>            
> <artifactId>
> hibernate-core
> </artifactId>
>>            
> <version>
> 5.3.2.Final
> </version>
>>        
> </dependency>
>>        
> <dependency>
>>            
> <groupId>
> org.hibernate
> </groupId>
>>            
> <artifactId>
> hibernate-annotations
> </artifactId>
>>            
> <version>
> 3.5.6-Final
> </version>
>>        
> </dependency>
>>
>>
>>
>> --
>> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>>





--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
monstereo monstereo
Reply | Threaded
Open this post in threaded view
|

Re: Hibernate L2 cache with Ignite. How?

This post was updated on .
Is there anyone can help?



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
ezhuravlev ezhuravlev
Reply | Threaded
Open this post in threaded view
|

Re: Hibernate L2 cache with Ignite. How?

if you enabled lgpl profile, you should have hibernate-4.2 and hibernate-5.1 modules, just choose the version that you have. Additionally, link that I've shared contains link to the 3rd party repository, which contains these artifacts, you can take them, if you're struggling with building it from sources.

Evgenii

2018-07-11 11:38 GMT+03:00 monstereo <[hidden email]>:
anyone could help me?

monstereo monstereo
Reply | Threaded
Open this post in threaded view
|

Re: Hibernate L2 cache with Ignite. How?

This post was updated on .
I can not solve this error :
(I have used this command $ mvn clean package -DskipTests -Prelease,lgpl in source file)

*Exception in thread "main" org.hibernate.service.spi.ServiceException:
Unable to create requested service [org.hibernate.cache.spi.RegionFactory]
at
org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:244)
at
org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:208)
at
org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:189)
at
org.hibernate.boot.internal.MetadataBuilderImpl$MetadataBuildingOptionsImpl.<init>(MetadataBuilderImpl.java:663)
at
org.hibernate.boot.internal.MetadataBuilderImpl.<init>(MetadataBuilderImpl.java:127)
at
org.hibernate.boot.internal.MetadataBuilderImpl.<init>(MetadataBuilderImpl.java:94)
at
org.hibernate.boot.MetadataSources.getMetadataBuilder(MetadataSources.java:125)
at
org.hibernate.boot.MetadataSources.buildMetadata(MetadataSources.java:179)
at MainApp.createHibernateSessionFactory(MainApp.java:31) at
MainApp.main(MainApp.java:65) Caused by: org.hibernate.HibernateException:
could not instantiate RegionFactory
[org.apache.ignite.cache.hibernate.HibernateRegionFactory] at
org.hibernate.cache.internal.RegionFactoryInitiator.initiateService(RegionFactoryInitiator.java:84)
at
org.hibernate.cache.internal.RegionFactoryInitiator.initiateService(RegionFactoryInitiator.java:29)
at
org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:88)
at
org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:234)
... 9 more Caused by:
org.hibernate.boot.registry.selector.spi.StrategySelectionException: Unable
to resolve name [org.apache.ignite.cache.hibernate.HibernateRegionFactory]
as strategy [org.hibernate.cache.spi.RegionFactory] at
org.hibernate.boot.registry.selector.internal.StrategySelectorImpl.selectStrategyImplementor(StrategySelectorImpl.java:113)
at
org.hibernate.cache.internal.RegionFactoryInitiator.initiateService(RegionFactoryInitiator.java:71)
... 12 more*



I have a database (postgres) which has Person table in testdb database, and
includes id, name, age, salary columns

Here is the my hibernate config file :  hibernate-cfg.xml
<http://apache-ignite-users.70518.x6.nabble.com/file/t1901/hibernate-cfg.xml

Here is the Person class  :  Person.java
<http://apache-ignite-users.70518.x6.nabble.com/file/t1901/Person.java

Here is the ignite configuration:  ignite-configuration.xml
<http://apache-ignite-users.70518.x6.nabble.com/file/t1901/ignite-configuration.xml

Here is the IgniteFactory class(I have created) :  IgniteFactory.java
<http://apache-ignite-users.70518.x6.nabble.com/file/t1901/IgniteFactory.java

Here is the pom.xml : pom.xml

Finally main class :  MainApp.java
<http://apache-ignite-users.70518.x6.nabble.com/file/t1901/MainApp.java



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
ezhuravlev ezhuravlev
Reply | Threaded
Open this post in threaded view
|

Re: Hibernate L2 cache with Ignite. How?

I've added maven dependency as was described before and this problem was resolved.

Evgenii

2018-07-12 15:25 GMT+03:00 monstereo <[hidden email]>:
I can not solve this error :

*Exception in thread "main" org.hibernate.service.spi.ServiceException:
Unable to create requested service [org.hibernate.cache.spi.RegionFactory]
at
org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:244)
at
org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:208)
at
org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:189)
at
org.hibernate.boot.internal.MetadataBuilderImpl$MetadataBuildingOptionsImpl.<init>(MetadataBuilderImpl.java:663)
at
org.hibernate.boot.internal.MetadataBuilderImpl.<init>(MetadataBuilderImpl.java:127)
at
org.hibernate.boot.internal.MetadataBuilderImpl.<init>(MetadataBuilderImpl.java:94)
at
org.hibernate.boot.MetadataSources.getMetadataBuilder(MetadataSources.java:125)
at
org.hibernate.boot.MetadataSources.buildMetadata(MetadataSources.java:179)
at MainApp.createHibernateSessionFactory(MainApp.java:31)       at
MainApp.main(MainApp.java:65) Caused by: org.hibernate.HibernateException:
could not instantiate RegionFactory
[org.apache.ignite.cache.hibernate.HibernateRegionFactory]      at
org.hibernate.cache.internal.RegionFactoryInitiator.initiateService(RegionFactoryInitiator.java:84)
at
org.hibernate.cache.internal.RegionFactoryInitiator.initiateService(RegionFactoryInitiator.java:29)
at
org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:88)
at
org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:234)
... 9 more Caused by:
org.hibernate.boot.registry.selector.spi.StrategySelectionException: Unable
to resolve name [org.apache.ignite.cache.hibernate.HibernateRegionFactory]
as strategy [org.hibernate.cache.spi.RegionFactory]     at
org.hibernate.boot.registry.selector.internal.StrategySelectorImpl.selectStrategyImplementor(StrategySelectorImpl.java:113)
at
org.hibernate.cache.internal.RegionFactoryInitiator.initiateService(RegionFactoryInitiator.java:71)
... 12 more*


I have a database (postgres) which has Person table in testdb database, and
includes id, name, age, salary columns

Here is the my hibernate config file :  hibernate-cfg.xml
<http://apache-ignite-users.70518.x6.nabble.com/file/t1901/hibernate-cfg.xml

Here is the Person class  :  Person.java
<http://apache-ignite-users.70518.x6.nabble.com/file/t1901/Person.java

Here is the ignite configuration:  ignite-configuration.xml
<http://apache-ignite-users.70518.x6.nabble.com/file/t1901/ignite-configuration.xml

Here is the IgniteFactory class(I have created) :  IgniteFactory.java
<http://apache-ignite-users.70518.x6.nabble.com/file/t1901/IgniteFactory.java

Finally main class :  MainApp.java
<http://apache-ignite-users.70518.x6.nabble.com/file/t1901/MainApp.java

monstereo monstereo
Reply | Threaded
Open this post in threaded view
|

Re: Hibernate L2 cache with Ignite. How?

?


ezhuravlev wrote
> I've added maven dependency as was described before and this problem was
> resolved.
>
> Evgenii
>
> 2018-07-12 15:25 GMT+03:00 monstereo &lt;

> mehmetozanguven@

> &gt;:
>
>> I can not solve this error :
>>
>> *Exception in thread "main" org.hibernate.service.spi.ServiceException:
>> Unable to create requested service
>> [org.hibernate.cache.spi.RegionFactory]
>>
>> at
>> org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(
>> AbstractServiceRegistryImpl.java:244)
>> at
>> org.hibernate.service.internal.AbstractServiceRegistryImpl.
>> initializeService(AbstractServiceRegistryImpl.java:208)
>> at
>> org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(
>> AbstractServiceRegistryImpl.java:189)
>> at
>> org.hibernate.boot.internal.MetadataBuilderImpl$
>> MetadataBuildingOptionsImpl.
> <init>
> (MetadataBuilderImpl.java:663)
>> at
>> org.hibernate.boot.internal.MetadataBuilderImpl.
> <init>
> (MetadataBuilderImpl.java:127)
>>
>> at
>> org.hibernate.boot.internal.MetadataBuilderImpl.
> <init>
> (MetadataBuilderImpl.java:94)
>>
>> at
>> org.hibernate.boot.MetadataSources.getMetadataBuilder(MetadataSources.java:125)
>>
>> at
>> org.hibernate.boot.MetadataSources.buildMetadata(MetadataSources.java:179)
>>
>> at MainApp.createHibernateSessionFactory(MainApp.java:31)       at
>> MainApp.main(MainApp.java:65) Caused by:
>> org.hibernate.HibernateException:
>> could not instantiate RegionFactory
>> [org.apache.ignite.cache.hibernate.HibernateRegionFactory]      at
>> org.hibernate.cache.internal.RegionFactoryInitiator.initiateService(
>> RegionFactoryInitiator.java:84)
>> at
>> org.hibernate.cache.internal.RegionFactoryInitiator.initiateService(
>> RegionFactoryInitiator.java:29)
>> at
>> org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.
>> initiateService(StandardServiceRegistryImpl.java:88)
>> at
>> org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(
>> AbstractServiceRegistryImpl.java:234)
>> ... 9 more Caused by:
>> org.hibernate.boot.registry.selector.spi.StrategySelectionException:
>> Unable
>> to resolve name
>> [org.apache.ignite.cache.hibernate.HibernateRegionFactory]
>> as strategy [org.hibernate.cache.spi.RegionFactory]     at
>> org.hibernate.boot.registry.selector.internal.StrategySelectorImpl.
>> selectStrategyImplementor(StrategySelectorImpl.java:113)
>> at
>> org.hibernate.cache.internal.RegionFactoryInitiator.initiateService(
>> RegionFactoryInitiator.java:71)
>> ... 12 more*
>>
>>
>> I have a database (postgres) which has Person table in testdb database,
>> and
>> includes id, name, age, salary columns
>>
>> Here is the my hibernate config file :  hibernate-cfg.xml
>> &lt;http://apache-ignite-users.70518.x6.nabble.com/file/
> &gt; t1901/hibernate-cfg.xml>
>>
>> Here is the Person class  :  Person.java
>> &lt;http://apache-ignite-users.70518.x6.nabble.com/file/t1901/Person.java&gt;
>>
>> Here is the ignite configuration:  ignite-configuration.xml
>> &lt;http://apache-ignite-users.70518.x6.nabble.com/file/
> &gt; t1901/ignite-configuration.xml>
>>
>> Here is the IgniteFactory class(I have created) :  IgniteFactory.java
>> &lt;http://apache-ignite-users.70518.x6.nabble.com/file/
> &gt; t1901/IgniteFactory.java>
>>
>> Finally main class :  MainApp.java
>> &lt;http://apache-ignite-users.70518.x6.nabble.com/file/t1901/MainApp.java&gt;
>>
>>
>>
>> --
>> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>>





--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
monstereo monstereo
Reply | Threaded
Open this post in threaded view
|

Re: Hibernate L2 cache with Ignite. How?

I know, it is hard to answer, but I don't know what exactly I should do...



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
ezhuravlev ezhuravlev
Reply | Threaded
Open this post in threaded view
|

Re: Hibernate L2 cache with Ignite. How?

Why can't you add the dependency from the 3rd party repository, that was described on the page I've shared earlier?

Evgenii

2018-07-12 16:22 GMT+03:00 monstereo <[hidden email]>:
I know, it is hard to answer, but I don't know what exactly I should do...

monstereo monstereo
Reply | Threaded
Open this post in threaded view
|

Re: Hibernate L2 cache with Ignite. How?

I couldn't find it...

ezhuravlev wrote
> Why can't you add the dependency from the 3rd party repository, that was
> described on the page I've shared earlier?
>
> Evgenii
>
> 2018-07-12 16:22 GMT+03:00 monstereo &lt;

> mehmetozanguven@

> &gt;:
>
>> I know, it is hard to answer, but I don't know what exactly I should
>> do...
>>
>>
>>
>> --
>> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>>





--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
monstereo monstereo
Reply | Threaded
Open this post in threaded view
|

Re: Hibernate L2 cache with Ignite. How?

I have installed gridgain-enterprise-fabric-8.4.4,
and in the folder */libs/optional/* there is /ignite-hibernate_5.1 folder
which includes :
                      hibernate-core-5.1.5.Final.jar and
ignite-hibernate_5.1-2.4.4.jar

and in the folder */libs/optional/* there is /ignite-hibernate-core folder
which includes:
                     ignite-hibernate-core-2.4.4.jar



additionally when I have used $ mvn clean package -DskipTests -Prelease,lgpl
this, after that I found

*/ApacheIgniteSourceFolder/apache-ignite-2.5.0-src/modules/hibernate-5.1*
and in the target folder there are 3 jars:
                  ignite-hibernate_5.1-2.5.0.jar,  
ignite-hibernate_5.1-2.5.0-sources.jar and
ignite-hibernate_5.1-2.5.0-sources.jar
same as hibernate-core folder

 



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
monstereo monstereo
Reply | Threaded
Open this post in threaded view
|

Re: Hibernate L2 cache with Ignite. How?

In reply to this post by ezhuravlev
Finally I can run the codes, and I am getting cache hits, puts or miss.

But I want to iterate all the cache, and want to see how many elements in
it.

(I could not see any configuration about cache key,value in the
ignite-configuration.xml)
(Actually its size always showing 0)
In ignite configuration.xml:

<property name="cacheConfiguration">
            <list>
                <bean parent="transactional-cache">
                    <property name="name" value="Person"/>
                </bean>

            </list>

        </property>

Here is the code that I have written:

public static void printCache(Ignite ignite){
        IgniteCache igniteCache = ignite.getOrCreateCache("Person");
        Iterator<Cache.Entry> itr = igniteCache.iterator();
        System.out.println("asdaas");
        while (itr.hasNext()){
            System.out.println(itr.next().getKey() + " " +
itr.next().getValue());
        }
    }





ezhuravlev wrote
> Why can't you add the dependency from the 3rd party repository, that was
> described on the page I've shared earlier?
>
> Evgenii
>
> 2018-07-12 16:22 GMT+03:00 monstereo &lt;

> mehmetozanguven@

> &gt;:
>
>> I know, it is hard to answer, but I don't know what exactly I should
>> do...
>>
>>
>>
>> --
>> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>>





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