You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Ravi Puri <ra...@gmail.com> on 2016/02/29 12:54:06 UTC
update the sql database after a particular limit?
How to update the sql database using cache after a particular time interval??
--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/update-the-sql-database-after-a-particular-limit-tp3250.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.
Re: update the sql database after a particular limit?
Posted by Vladimir Ozerov <vo...@gridgain.com>.
Ravi,
There is no built-in mechanism to automatically retrieve updates from
database. I would suggest you to do the following:
1) Configure a cache store (e.g. see CacheJdbcPojoStore).
2) Set flags CacheConfiguration.setReadThrough() and
CacheConfigutration.setWriteThrough() to true.
3) Whenever you want to change database data, update the cache, not the
database. Ignite will transfer this change to the database.
Vladimir.
On Tue, Mar 1, 2016 at 8:32 AM, Ravi Puri <ra...@gmail.com> wrote:
> Suppose i have a employee data and its login time . I want to fetch the
> data
> from database and store it in cache and everytime i login if its changes in
> database then i want to reflect back in cache too. As i want my code to
> work
> consistently with cache data rather than database
> ??
>
> please suggest me ways how to configure and and some code changes in get
> and
> put operation
>
>
>
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/update-the-sql-database-after-a-particular-limit-tp3250p3279.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>
Re: update the sql database after a particular limit?
Posted by Ravi Puri <ra...@gmail.com>.
Suppose i have a employee data and its login time . I want to fetch the data
from database and store it in cache and everytime i login if its changes in
database then i want to reflect back in cache too. As i want my code to work
consistently with cache data rather than database
??
please suggest me ways how to configure and and some code changes in get and
put operation
--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/update-the-sql-database-after-a-particular-limit-tp3250p3279.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.
Re: update the sql database after a particular limit?
Posted by Vladimir Ozerov <vo...@gridgain.com>.
Ravi,
What do you mean by "update the sql database"? If you configured a store
and enabled write-through mode, database will be updated as soon as
corresponding cached entry is changed.
Vladimir.
On Mon, Feb 29, 2016 at 2:54 PM, Ravi Puri <ra...@gmail.com>
wrote:
> How to update the sql database using cache after a particular time
> interval??
>
>
>
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/update-the-sql-database-after-a-particular-limit-tp3250.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>