You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Anindya Mukherjee <an...@gmail.com> on 2009/07/15 21:06:11 UTC

Force cache refresh + precaching

Hi ,

 

We have started using iBatis caches. To start with we are using an LRU
cache. However we have an issue ,  the underlying tables in our db can be
updated by manual inserts ( it is a shared db used by a number of apps ).

 

Now we need a mechanism whereby we can forcefully refresh the iBatis cache.
Can anybody help us with this ? Also the ibatis caches are lazy loading ( it
loads on demand ) , is it possible to somehow precache some data during app
load.

 

-          Thanks,

-          Anindya


Re: Force cache refresh + precaching

Posted by Sundar Sankar <fa...@gmail.com>.
If you wanna fetch from a cache and manually update the cache in the
background or something like that, u cud also look at different caching
mechanisms which ibatis doesnt offer. Jboss cache was great for me, it uses
lucene and aparently for the data i have, it is super fast.

-Sundar

On Thu, Jul 16, 2009 at 9:59 AM, Anindya Mukherjee <
anindya.mukherjee@gmail.com> wrote:

>  Ok got it.. Makes sense actually.. So looks like the only way to precache
> is running all the possible queries ( that I expect ) during app load.
>
>
>
> -          Anindya
>
>
>
> *From:* Chris O'Connell [mailto:oconnell@gorillachicago.com]
> *Sent:* July-16-09 8:33 PM
> *To:* user-java@ibatis.apache.org
> *Subject:* Re: Force cache refresh + precaching
>
>
>
> Since no one else has replied...  I think you are looking at the iBatis
> cache the wrong way.  My understanding of the cache is that it doesn't cache
> data from a table, it caches the results of queries.  Note that the code to
> refresh the cache takes the name of the query that you want refreshed, not
> the name of a table that you want refreshed.
>
>
>
> -- Chris
>
> On Wed, Jul 15, 2009 at 11:34 PM, Anindya Mukherjee <
> anindya.mukherjee@gmail.com> wrote:
>
> Hi all,
>
> Thanks a lot for your replies. Actually our's is a web application that
> makes a lot of AJAX calls to get this data. We want these call's to be as
> fast as possible. A slight delay even for the first time might be an issue.
>
> So we were thinking if there is a way to precache the whole table during
> app
> start rather than having it on demand.
>
> The problem with running the queries on app startup is , we have a lot of
> data in the table. We could call the queries but that will be a lot of
> call's. Also if the data changes we have to add/remove our queries. So if
> there is a way of telling IBatis to precache the whole table it will be
> really nice.
>
> - Anindya
>
> -----Original Message-----
> From: Jeff Butler [mailto:jeffgbutler@gmail.com]
> Sent: July-16-09 2:15 AM
> To: user-java@ibatis.apache.org
> Subject: Re: Force cache refresh + precaching
>
> Why not just execute the query in some startup process, this would
> prime the cache?  In a web app you could do it in a context listener.
> Easy.
>
>
> Jeff Butler
>
> On Wed, Jul 15, 2009 at 3:34 PM, Sundar Sankar<fa...@gmail.com>
> wrote:
> > I havent implemented this particular case, but I wud have to suggest you
> go
> > with other technologies in conjunction, maybe comet or something like
> that.
> > Am not sure if hibernate / hibernate cache handles this case but i wud
> look
> > to check up with their dev team too.
> >
> > On Wed, Jul 15, 2009 at 1:25 PM, Vinaya Tirikkovalluru
> > <vi...@converge.com> wrote:
> >>
> >> Is there a specific reason why do you want to do that?
> >>
> >> Because, the first time you access the object, it will be created and
> >> stored in cache
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> ________________________________
> >>
> >> From: Anindya Mukherjee [mailto:anindya.mukherjee@gmail.com]
> >> Sent: Wednesday, July 15, 2009 3:28 PM
> >>
> >> To: user-java@ibatis.apache.org
> >> Subject: RE: Force cache refresh + precaching
> >>
> >>
> >>
> >> Hi Vinaya,
> >>
> >>
> >>
> >> Thanks a lot for the help. I actually meant during app load ( when our
> >> application is booting ).
> >>
> >>
> >>
> >> -          Anindya
> >>
> >>
> >>
> >> From: Vinaya Tirikkovalluru [mailto:vinaya.tirikkovalluru@converge.com]
> >> Sent: July-16-09 12:41 AM
> >> To: user-java@ibatis.apache.org
> >> Subject: RE: Force cache refresh + precaching
> >>
> >>
> >>
> >> Hi,
> >>
> >>
> >>
> >> What do you mean by before app load?
> >>
> >>
> >>
> >> To forcefully refresh the cache, you can use
> >>
> >>
> >>
> >> getSqlMapClient().flushDataCache("sqlmap.queryname");
> >>
> >>
> >>
> >> Vinaya
> >>
> >>
> >>
> >> ________________________________
> >>
> >> From: Anindya Mukherjee [mailto:anindya.mukherjee@gmail.com]
> >> Sent: Wednesday, July 15, 2009 3:06 PM
> >> To: user-java@ibatis.apache.org
> >> Cc: anindya.mukherjee@gmail.com
> >> Subject: Force cache refresh + precaching
> >>
> >>
> >>
> >> Hi ,
> >>
> >>
> >>
> >> We have started using iBatis caches. To start with we are using an LRU
> >> cache. However we have an issue ,  the underlying tables in our db can
> be
> >> updated by manual inserts ( it is a shared db used by a number of apps
> ).
> >>
> >>
> >>
> >> Now we need a mechanism whereby we can forcefully refresh the iBatis
> >> cache. Can anybody help us with this ? Also the ibatis caches are lazy
> >> loading ( it loads on demand ) , is it possible to somehow precache some
> >> data during app load.
> >>
> >>
> >>
> >> -          Thanks,
> >>
> >> -          Anindya
> >>
> >> ________________________________
> >>
> >> This electronic message is intended only for the use of the
> individual(s)
> >> or entity(ies) named above and may contain information which is
> privileged
> >> and/or confidential. If you are not the intended recipient, be aware
> that
> >> any disclosure, copying, distribution, dissemination or use of the
> contents
> >> of this message is prohibited. If you received this message in error,
> please
> >> notify the sender immediately.
> >>
> >> ________________________________
> >> This electronic message is intended only for the use of the
> individual(s)
> >> or entity(ies) named above and may contain information which is
> privileged
> >> and/or confidential. If you are not the intended recipient, be aware
> that
> >> any disclosure, copying, distribution, dissemination or use of the
> contents
> >> of this message is prohibited. If you received this message in error,
> please
> >> notify the sender immediately.
> >
> >
> > --
> > Regards
> > Sundar S.
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
> For additional commands, e-mail: user-java-help@ibatis.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
> For additional commands, e-mail: user-java-help@ibatis.apache.org
>
>
>
>
> --
> --
> Chris O'Connell
> Application Developer
> Gorilla
> 312.243.8777 x19
>



-- 
Regards
Sundar S.

RE: Force cache refresh + precaching

Posted by Anindya Mukherjee <an...@gmail.com>.
Ok got it.. Makes sense actually.. So looks like the only way to precache is running all the possible queries ( that I expect ) during app load. 

 

-          Anindya

 

From: Chris O'Connell [mailto:oconnell@gorillachicago.com] 
Sent: July-16-09 8:33 PM
To: user-java@ibatis.apache.org
Subject: Re: Force cache refresh + precaching

 

Since no one else has replied...  I think you are looking at the iBatis cache the wrong way.  My understanding of the cache is that it doesn't cache data from a table, it caches the results of queries.  Note that the code to refresh the cache takes the name of the query that you want refreshed, not the name of a table that you want refreshed.

 

-- Chris

On Wed, Jul 15, 2009 at 11:34 PM, Anindya Mukherjee <an...@gmail.com> wrote:

Hi all,

Thanks a lot for your replies. Actually our's is a web application that
makes a lot of AJAX calls to get this data. We want these call's to be as
fast as possible. A slight delay even for the first time might be an issue.

So we were thinking if there is a way to precache the whole table during app
start rather than having it on demand.

The problem with running the queries on app startup is , we have a lot of
data in the table. We could call the queries but that will be a lot of
call's. Also if the data changes we have to add/remove our queries. So if
there is a way of telling IBatis to precache the whole table it will be
really nice.

- Anindya

-----Original Message-----
From: Jeff Butler [mailto:jeffgbutler@gmail.com]
Sent: July-16-09 2:15 AM
To: user-java@ibatis.apache.org
Subject: Re: Force cache refresh + precaching

Why not just execute the query in some startup process, this would
prime the cache?  In a web app you could do it in a context listener.
Easy.


Jeff Butler

On Wed, Jul 15, 2009 at 3:34 PM, Sundar Sankar<fa...@gmail.com> wrote:
> I havent implemented this particular case, but I wud have to suggest you
go
> with other technologies in conjunction, maybe comet or something like
that.
> Am not sure if hibernate / hibernate cache handles this case but i wud
look
> to check up with their dev team too.
>
> On Wed, Jul 15, 2009 at 1:25 PM, Vinaya Tirikkovalluru
> <vi...@converge.com> wrote:
>>
>> Is there a specific reason why do you want to do that?
>>
>> Because, the first time you access the object, it will be created and
>> stored in cache
>>
>>
>>
>>
>>
>>
>>
>> ________________________________
>>
>> From: Anindya Mukherjee [mailto:anindya.mukherjee@gmail.com]
>> Sent: Wednesday, July 15, 2009 3:28 PM
>>
>> To: user-java@ibatis.apache.org
>> Subject: RE: Force cache refresh + precaching
>>
>>
>>
>> Hi Vinaya,
>>
>>
>>
>> Thanks a lot for the help. I actually meant during app load ( when our
>> application is booting ).
>>
>>
>>
>> -          Anindya
>>
>>
>>
>> From: Vinaya Tirikkovalluru [mailto:vinaya.tirikkovalluru@converge.com]
>> Sent: July-16-09 12:41 AM
>> To: user-java@ibatis.apache.org
>> Subject: RE: Force cache refresh + precaching
>>
>>
>>
>> Hi,
>>
>>
>>
>> What do you mean by before app load?
>>
>>
>>
>> To forcefully refresh the cache, you can use
>>
>>
>>
>> getSqlMapClient().flushDataCache("sqlmap.queryname");
>>
>>
>>
>> Vinaya
>>
>>
>>
>> ________________________________
>>
>> From: Anindya Mukherjee [mailto:anindya.mukherjee@gmail.com]
>> Sent: Wednesday, July 15, 2009 3:06 PM
>> To: user-java@ibatis.apache.org
>> Cc: anindya.mukherjee@gmail.com
>> Subject: Force cache refresh + precaching
>>
>>
>>
>> Hi ,
>>
>>
>>
>> We have started using iBatis caches. To start with we are using an LRU
>> cache. However we have an issue ,  the underlying tables in our db can be
>> updated by manual inserts ( it is a shared db used by a number of apps ).
>>
>>
>>
>> Now we need a mechanism whereby we can forcefully refresh the iBatis
>> cache. Can anybody help us with this ? Also the ibatis caches are lazy
>> loading ( it loads on demand ) , is it possible to somehow precache some
>> data during app load.
>>
>>
>>
>> -          Thanks,
>>
>> -          Anindya
>>
>> ________________________________
>>
>> This electronic message is intended only for the use of the individual(s)
>> or entity(ies) named above and may contain information which is
privileged
>> and/or confidential. If you are not the intended recipient, be aware that
>> any disclosure, copying, distribution, dissemination or use of the
contents
>> of this message is prohibited. If you received this message in error,
please
>> notify the sender immediately.
>>
>> ________________________________
>> This electronic message is intended only for the use of the individual(s)
>> or entity(ies) named above and may contain information which is
privileged
>> and/or confidential. If you are not the intended recipient, be aware that
>> any disclosure, copying, distribution, dissemination or use of the
contents
>> of this message is prohibited. If you received this message in error,
please
>> notify the sender immediately.
>
>
> --
> Regards
> Sundar S.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org




-- 
-- 
Chris O'Connell
Application Developer
Gorilla
312.243.8777 x19


Re: Force cache refresh + precaching

Posted by Chris O'Connell <oc...@gorillachicago.com>.
Since no one else has replied...  I think you are looking at the iBatis
cache the wrong way.  My understanding of the cache is that it doesn't cache
data from a table, it caches the results of queries.  Note that the code to
refresh the cache takes the name of the query that you want refreshed, not
the name of a table that you want refreshed.
-- Chris

On Wed, Jul 15, 2009 at 11:34 PM, Anindya Mukherjee <
anindya.mukherjee@gmail.com> wrote:

> Hi all,
>
> Thanks a lot for your replies. Actually our's is a web application that
> makes a lot of AJAX calls to get this data. We want these call's to be as
> fast as possible. A slight delay even for the first time might be an issue.
>
> So we were thinking if there is a way to precache the whole table during
> app
> start rather than having it on demand.
>
> The problem with running the queries on app startup is , we have a lot of
> data in the table. We could call the queries but that will be a lot of
> call's. Also if the data changes we have to add/remove our queries. So if
> there is a way of telling IBatis to precache the whole table it will be
> really nice.
>
> - Anindya
>
> -----Original Message-----
> From: Jeff Butler [mailto:jeffgbutler@gmail.com]
> Sent: July-16-09 2:15 AM
> To: user-java@ibatis.apache.org
> Subject: Re: Force cache refresh + precaching
>
> Why not just execute the query in some startup process, this would
> prime the cache?  In a web app you could do it in a context listener.
> Easy.
>
>
> Jeff Butler
>
> On Wed, Jul 15, 2009 at 3:34 PM, Sundar Sankar<fa...@gmail.com>
> wrote:
> > I havent implemented this particular case, but I wud have to suggest you
> go
> > with other technologies in conjunction, maybe comet or something like
> that.
> > Am not sure if hibernate / hibernate cache handles this case but i wud
> look
> > to check up with their dev team too.
> >
> > On Wed, Jul 15, 2009 at 1:25 PM, Vinaya Tirikkovalluru
> > <vi...@converge.com> wrote:
> >>
> >> Is there a specific reason why do you want to do that?
> >>
> >> Because, the first time you access the object, it will be created and
> >> stored in cache
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> ________________________________
> >>
> >> From: Anindya Mukherjee [mailto:anindya.mukherjee@gmail.com]
> >> Sent: Wednesday, July 15, 2009 3:28 PM
> >>
> >> To: user-java@ibatis.apache.org
> >> Subject: RE: Force cache refresh + precaching
> >>
> >>
> >>
> >> Hi Vinaya,
> >>
> >>
> >>
> >> Thanks a lot for the help. I actually meant during app load ( when our
> >> application is booting ).
> >>
> >>
> >>
> >> -          Anindya
> >>
> >>
> >>
> >> From: Vinaya Tirikkovalluru [mailto:vinaya.tirikkovalluru@converge.com]
> >> Sent: July-16-09 12:41 AM
> >> To: user-java@ibatis.apache.org
> >> Subject: RE: Force cache refresh + precaching
> >>
> >>
> >>
> >> Hi,
> >>
> >>
> >>
> >> What do you mean by before app load?
> >>
> >>
> >>
> >> To forcefully refresh the cache, you can use
> >>
> >>
> >>
> >> getSqlMapClient().flushDataCache("sqlmap.queryname");
> >>
> >>
> >>
> >> Vinaya
> >>
> >>
> >>
> >> ________________________________
> >>
> >> From: Anindya Mukherjee [mailto:anindya.mukherjee@gmail.com]
> >> Sent: Wednesday, July 15, 2009 3:06 PM
> >> To: user-java@ibatis.apache.org
> >> Cc: anindya.mukherjee@gmail.com
> >> Subject: Force cache refresh + precaching
> >>
> >>
> >>
> >> Hi ,
> >>
> >>
> >>
> >> We have started using iBatis caches. To start with we are using an LRU
> >> cache. However we have an issue ,  the underlying tables in our db can
> be
> >> updated by manual inserts ( it is a shared db used by a number of apps
> ).
> >>
> >>
> >>
> >> Now we need a mechanism whereby we can forcefully refresh the iBatis
> >> cache. Can anybody help us with this ? Also the ibatis caches are lazy
> >> loading ( it loads on demand ) , is it possible to somehow precache some
> >> data during app load.
> >>
> >>
> >>
> >> -          Thanks,
> >>
> >> -          Anindya
> >>
> >> ________________________________
> >>
> >> This electronic message is intended only for the use of the
> individual(s)
> >> or entity(ies) named above and may contain information which is
> privileged
> >> and/or confidential. If you are not the intended recipient, be aware
> that
> >> any disclosure, copying, distribution, dissemination or use of the
> contents
> >> of this message is prohibited. If you received this message in error,
> please
> >> notify the sender immediately.
> >>
> >> ________________________________
> >> This electronic message is intended only for the use of the
> individual(s)
> >> or entity(ies) named above and may contain information which is
> privileged
> >> and/or confidential. If you are not the intended recipient, be aware
> that
> >> any disclosure, copying, distribution, dissemination or use of the
> contents
> >> of this message is prohibited. If you received this message in error,
> please
> >> notify the sender immediately.
> >
> >
> > --
> > Regards
> > Sundar S.
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
> For additional commands, e-mail: user-java-help@ibatis.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
> For additional commands, e-mail: user-java-help@ibatis.apache.org
>
>


-- 
-- 
Chris O'Connell
Application Developer
Gorilla
312.243.8777 x19

RE: Force cache refresh + precaching

Posted by Ch...@sybase.com.
We have an application that has a similar requirement; caching catalog 
data to build a tree representation for the UI. This was an expensive hit 
for the user to pay. Rather than asking iBatis to cache the entire table, 
we let iBatis cache the results for each query. For the web UI, I simply 
built a dynamic cache mechanism using ehCache. We not only use it for the 
product catalog but also customer data as well as others. It builds caches 
based upon request parameters. For the Product Catalog, we cache the 
entire table. The cache is managed by Spring and is populated on 
application start-up by some simply looping logic that first the top level 
query and drills down from there. It is scheduled for refresh ever so many 
hours and can be invalidated using JConsole as we exposed the cache via 
JMX.. 

As far as external updates to the data within the database, depending upon 
what database you are using, you may have some options available. For 
example, both Oracle and Sybase ASE have the ability to send JMS messages 
to a Queue or Topic directly from SQL. So you could easily create a 
trigger on those tables that get updated, produce a message to a Topic 
telling about the update, and have you application consume the message and 
invalidate or refresh your cache.

For what you are asking for, you are going to need to build something to 
accomplish your task. While you can have iBatis cache your results for 
you, it simply is not going to fit your use case. 

Chris Mathrusse
christopher.mathrusse@sybase.com
Sybase, Inc



From:
"Anindya Mukherjee" <an...@gmail.com>
To:
<us...@ibatis.apache.org>
Date:
07/15/2009 09:34 PM
Subject:
RE: Force cache refresh + precaching



Hi all,

Thanks a lot for your replies. Actually our's is a web application that
makes a lot of AJAX calls to get this data. We want these call's to be as
fast as possible. A slight delay even for the first time might be an 
issue.

So we were thinking if there is a way to precache the whole table during 
app
start rather than having it on demand.

The problem with running the queries on app startup is , we have a lot of
data in the table. We could call the queries but that will be a lot of
call's. Also if the data changes we have to add/remove our queries. So if
there is a way of telling IBatis to precache the whole table it will be
really nice.

- Anindya

-----Original Message-----
From: Jeff Butler [mailto:jeffgbutler@gmail.com] 
Sent: July-16-09 2:15 AM
To: user-java@ibatis.apache.org
Subject: Re: Force cache refresh + precaching

Why not just execute the query in some startup process, this would
prime the cache?  In a web app you could do it in a context listener.
Easy.


Jeff Butler

On Wed, Jul 15, 2009 at 3:34 PM, Sundar Sankar<fa...@gmail.com> 
wrote:
> I havent implemented this particular case, but I wud have to suggest you
go
> with other technologies in conjunction, maybe comet or something like
that.
> Am not sure if hibernate / hibernate cache handles this case but i wud
look
> to check up with their dev team too.
>
> On Wed, Jul 15, 2009 at 1:25 PM, Vinaya Tirikkovalluru
> <vi...@converge.com> wrote:
>>
>> Is there a specific reason why do you want to do that?
>>
>> Because, the first time you access the object, it will be created and
>> stored in cache
>>
>>
>>
>>
>>
>>
>>
>> ________________________________
>>
>> From: Anindya Mukherjee [mailto:anindya.mukherjee@gmail.com]
>> Sent: Wednesday, July 15, 2009 3:28 PM
>>
>> To: user-java@ibatis.apache.org
>> Subject: RE: Force cache refresh + precaching
>>
>>
>>
>> Hi Vinaya,
>>
>>
>>
>> Thanks a lot for the help. I actually meant during app load ( when our
>> application is booting ).
>>
>>
>>
>> -          Anindya
>>
>>
>>
>> From: Vinaya Tirikkovalluru [mailto:vinaya.tirikkovalluru@converge.com]
>> Sent: July-16-09 12:41 AM
>> To: user-java@ibatis.apache.org
>> Subject: RE: Force cache refresh + precaching
>>
>>
>>
>> Hi,
>>
>>
>>
>> What do you mean by before app load?
>>
>>
>>
>> To forcefully refresh the cache, you can use
>>
>>
>>
>> getSqlMapClient().flushDataCache("sqlmap.queryname");
>>
>>
>>
>> Vinaya
>>
>>
>>
>> ________________________________
>>
>> From: Anindya Mukherjee [mailto:anindya.mukherjee@gmail.com]
>> Sent: Wednesday, July 15, 2009 3:06 PM
>> To: user-java@ibatis.apache.org
>> Cc: anindya.mukherjee@gmail.com
>> Subject: Force cache refresh + precaching
>>
>>
>>
>> Hi ,
>>
>>
>>
>> We have started using iBatis caches. To start with we are using an LRU
>> cache. However we have an issue ,  the underlying tables in our db can 
be
>> updated by manual inserts ( it is a shared db used by a number of apps 
).
>>
>>
>>
>> Now we need a mechanism whereby we can forcefully refresh the iBatis
>> cache. Can anybody help us with this ? Also the ibatis caches are lazy
>> loading ( it loads on demand ) , is it possible to somehow precache 
some
>> data during app load.
>>
>>
>>
>> -          Thanks,
>>
>> -          Anindya
>>
>> ________________________________
>>
>> This electronic message is intended only for the use of the 
individual(s)
>> or entity(ies) named above and may contain information which is
privileged
>> and/or confidential. If you are not the intended recipient, be aware 
that
>> any disclosure, copying, distribution, dissemination or use of the
contents
>> of this message is prohibited. If you received this message in error,
please
>> notify the sender immediately.
>>
>> ________________________________
>> This electronic message is intended only for the use of the 
individual(s)
>> or entity(ies) named above and may contain information which is
privileged
>> and/or confidential. If you are not the intended recipient, be aware 
that
>> any disclosure, copying, distribution, dissemination or use of the
contents
>> of this message is prohibited. If you received this message in error,
please
>> notify the sender immediately.
>
>
> --
> Regards
> Sundar S.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org





RE: Force cache refresh + precaching

Posted by Anindya Mukherjee <an...@gmail.com>.
Hi all,

Thanks a lot for your replies. Actually our's is a web application that
makes a lot of AJAX calls to get this data. We want these call's to be as
fast as possible. A slight delay even for the first time might be an issue.

So we were thinking if there is a way to precache the whole table during app
start rather than having it on demand.

The problem with running the queries on app startup is , we have a lot of
data in the table. We could call the queries but that will be a lot of
call's. Also if the data changes we have to add/remove our queries. So if
there is a way of telling IBatis to precache the whole table it will be
really nice.

- Anindya

-----Original Message-----
From: Jeff Butler [mailto:jeffgbutler@gmail.com] 
Sent: July-16-09 2:15 AM
To: user-java@ibatis.apache.org
Subject: Re: Force cache refresh + precaching

Why not just execute the query in some startup process, this would
prime the cache?  In a web app you could do it in a context listener.
Easy.


Jeff Butler

On Wed, Jul 15, 2009 at 3:34 PM, Sundar Sankar<fa...@gmail.com> wrote:
> I havent implemented this particular case, but I wud have to suggest you
go
> with other technologies in conjunction, maybe comet or something like
that.
> Am not sure if hibernate / hibernate cache handles this case but i wud
look
> to check up with their dev team too.
>
> On Wed, Jul 15, 2009 at 1:25 PM, Vinaya Tirikkovalluru
> <vi...@converge.com> wrote:
>>
>> Is there a specific reason why do you want to do that?
>>
>> Because, the first time you access the object, it will be created and
>> stored in cache
>>
>>
>>
>>
>>
>>
>>
>> ________________________________
>>
>> From: Anindya Mukherjee [mailto:anindya.mukherjee@gmail.com]
>> Sent: Wednesday, July 15, 2009 3:28 PM
>>
>> To: user-java@ibatis.apache.org
>> Subject: RE: Force cache refresh + precaching
>>
>>
>>
>> Hi Vinaya,
>>
>>
>>
>> Thanks a lot for the help. I actually meant during app load ( when our
>> application is booting ).
>>
>>
>>
>> -          Anindya
>>
>>
>>
>> From: Vinaya Tirikkovalluru [mailto:vinaya.tirikkovalluru@converge.com]
>> Sent: July-16-09 12:41 AM
>> To: user-java@ibatis.apache.org
>> Subject: RE: Force cache refresh + precaching
>>
>>
>>
>> Hi,
>>
>>
>>
>> What do you mean by before app load?
>>
>>
>>
>> To forcefully refresh the cache, you can use
>>
>>
>>
>> getSqlMapClient().flushDataCache("sqlmap.queryname");
>>
>>
>>
>> Vinaya
>>
>>
>>
>> ________________________________
>>
>> From: Anindya Mukherjee [mailto:anindya.mukherjee@gmail.com]
>> Sent: Wednesday, July 15, 2009 3:06 PM
>> To: user-java@ibatis.apache.org
>> Cc: anindya.mukherjee@gmail.com
>> Subject: Force cache refresh + precaching
>>
>>
>>
>> Hi ,
>>
>>
>>
>> We have started using iBatis caches. To start with we are using an LRU
>> cache. However we have an issue ,  the underlying tables in our db can be
>> updated by manual inserts ( it is a shared db used by a number of apps ).
>>
>>
>>
>> Now we need a mechanism whereby we can forcefully refresh the iBatis
>> cache. Can anybody help us with this ? Also the ibatis caches are lazy
>> loading ( it loads on demand ) , is it possible to somehow precache some
>> data during app load.
>>
>>
>>
>> -          Thanks,
>>
>> -          Anindya
>>
>> ________________________________
>>
>> This electronic message is intended only for the use of the individual(s)
>> or entity(ies) named above and may contain information which is
privileged
>> and/or confidential. If you are not the intended recipient, be aware that
>> any disclosure, copying, distribution, dissemination or use of the
contents
>> of this message is prohibited. If you received this message in error,
please
>> notify the sender immediately.
>>
>> ________________________________
>> This electronic message is intended only for the use of the individual(s)
>> or entity(ies) named above and may contain information which is
privileged
>> and/or confidential. If you are not the intended recipient, be aware that
>> any disclosure, copying, distribution, dissemination or use of the
contents
>> of this message is prohibited. If you received this message in error,
please
>> notify the sender immediately.
>
>
> --
> Regards
> Sundar S.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


Re: Force cache refresh + precaching

Posted by Jeff Butler <je...@gmail.com>.
Why not just execute the query in some startup process, this would
prime the cache?  In a web app you could do it in a context listener.
Easy.


Jeff Butler

On Wed, Jul 15, 2009 at 3:34 PM, Sundar Sankar<fa...@gmail.com> wrote:
> I havent implemented this particular case, but I wud have to suggest you go
> with other technologies in conjunction, maybe comet or something like that.
> Am not sure if hibernate / hibernate cache handles this case but i wud look
> to check up with their dev team too.
>
> On Wed, Jul 15, 2009 at 1:25 PM, Vinaya Tirikkovalluru
> <vi...@converge.com> wrote:
>>
>> Is there a specific reason why do you want to do that?
>>
>> Because, the first time you access the object, it will be created and
>> stored in cache
>>
>>
>>
>>
>>
>>
>>
>> ________________________________
>>
>> From: Anindya Mukherjee [mailto:anindya.mukherjee@gmail.com]
>> Sent: Wednesday, July 15, 2009 3:28 PM
>>
>> To: user-java@ibatis.apache.org
>> Subject: RE: Force cache refresh + precaching
>>
>>
>>
>> Hi Vinaya,
>>
>>
>>
>> Thanks a lot for the help. I actually meant during app load ( when our
>> application is booting ).
>>
>>
>>
>> -          Anindya
>>
>>
>>
>> From: Vinaya Tirikkovalluru [mailto:vinaya.tirikkovalluru@converge.com]
>> Sent: July-16-09 12:41 AM
>> To: user-java@ibatis.apache.org
>> Subject: RE: Force cache refresh + precaching
>>
>>
>>
>> Hi,
>>
>>
>>
>> What do you mean by before app load?
>>
>>
>>
>> To forcefully refresh the cache, you can use
>>
>>
>>
>> getSqlMapClient().flushDataCache("sqlmap.queryname");
>>
>>
>>
>> Vinaya
>>
>>
>>
>> ________________________________
>>
>> From: Anindya Mukherjee [mailto:anindya.mukherjee@gmail.com]
>> Sent: Wednesday, July 15, 2009 3:06 PM
>> To: user-java@ibatis.apache.org
>> Cc: anindya.mukherjee@gmail.com
>> Subject: Force cache refresh + precaching
>>
>>
>>
>> Hi ,
>>
>>
>>
>> We have started using iBatis caches. To start with we are using an LRU
>> cache. However we have an issue ,  the underlying tables in our db can be
>> updated by manual inserts ( it is a shared db used by a number of apps ).
>>
>>
>>
>> Now we need a mechanism whereby we can forcefully refresh the iBatis
>> cache. Can anybody help us with this ? Also the ibatis caches are lazy
>> loading ( it loads on demand ) , is it possible to somehow precache some
>> data during app load.
>>
>>
>>
>> -          Thanks,
>>
>> -          Anindya
>>
>> ________________________________
>>
>> This electronic message is intended only for the use of the individual(s)
>> or entity(ies) named above and may contain information which is privileged
>> and/or confidential. If you are not the intended recipient, be aware that
>> any disclosure, copying, distribution, dissemination or use of the contents
>> of this message is prohibited. If you received this message in error, please
>> notify the sender immediately.
>>
>> ________________________________
>> This electronic message is intended only for the use of the individual(s)
>> or entity(ies) named above and may contain information which is privileged
>> and/or confidential. If you are not the intended recipient, be aware that
>> any disclosure, copying, distribution, dissemination or use of the contents
>> of this message is prohibited. If you received this message in error, please
>> notify the sender immediately.
>
>
> --
> Regards
> Sundar S.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


Re: Force cache refresh + precaching

Posted by Sundar Sankar <fa...@gmail.com>.
I havent implemented this particular case, but I wud have to suggest you go
with other technologies in conjunction, maybe comet or something like that.
Am not sure if hibernate / hibernate cache handles this case but i wud look
to check up with their dev team too.

On Wed, Jul 15, 2009 at 1:25 PM, Vinaya Tirikkovalluru <
vinaya.tirikkovalluru@converge.com> wrote:

>  Is there a specific reason why do you want to do that?
>
> Because, the first time you access the object, it will be created and
> stored in cache
>
>
>
>
>
>
>  ------------------------------
>
> *From:* Anindya Mukherjee [mailto:anindya.mukherjee@gmail.com]
> *Sent:* Wednesday, July 15, 2009 3:28 PM
> *To:* user-java@ibatis.apache.org
> *Subject:* RE: Force cache refresh + precaching
>
>
>
> Hi Vinaya,
>
>
>
> Thanks a lot for the help. I actually meant during app load ( when our
> application is booting ).
>
>
>
> -          Anindya
>
>
>
> *From:* Vinaya Tirikkovalluru [mailto:vinaya.tirikkovalluru@converge.com]
> *Sent:* July-16-09 12:41 AM
> *To:* user-java@ibatis.apache.org
> *Subject:* RE: Force cache refresh + precaching
>
>
>
> Hi,
>
>
>
> What do you mean by before app load?
>
>
>
> To forcefully refresh the cache, you can use
>
>
>
> getSqlMapClient().flushDataCache("sqlmap.queryname");
>
>
>
> Vinaya
>
>
>  ------------------------------
>
> *From:* Anindya Mukherjee [mailto:anindya.mukherjee@gmail.com]
> *Sent:* Wednesday, July 15, 2009 3:06 PM
> *To:* user-java@ibatis.apache.org
> *Cc:* anindya.mukherjee@gmail.com
> *Subject:* Force cache refresh + precaching
>
>
>
> Hi ,
>
>
>
> We have started using iBatis caches. To start with we are using an LRU
> cache. However we have an issue ,  the underlying tables in our db can be
> updated by manual inserts ( it is a shared db used by a number of apps ).
>
>
>
> Now we need a mechanism whereby we can forcefully refresh the iBatis cache.
> Can anybody help us with this ? Also the ibatis caches are lazy loading ( it
> loads on demand ) , is it possible to somehow precache some data during app
> load.
>
>
>
> -          Thanks,
>
> -          Anindya
>  ------------------------------
>
> This electronic message is intended only for the use of the individual(s)
> or entity(ies) named above and may contain information which is privileged
> and/or confidential. If you are not the intended recipient, be aware that
> any disclosure, copying, distribution, dissemination or use of the contents
> of this message is prohibited. If you received this message in error, please
> notify the sender immediately.
>
> ------------------------------
> This electronic message is intended only for the use of the individual(s)
> or entity(ies) named above and may contain information which is privileged
> and/or confidential. If you are not the intended recipient, be aware that
> any disclosure, copying, distribution, dissemination or use of the contents
> of this message is prohibited. If you received this message in error, please
> notify the sender immediately.
>



-- 
Regards
Sundar S.

RE: Force cache refresh + precaching

Posted by Vinaya Tirikkovalluru <vi...@converge.com>.
Is there a specific reason why do you want to do that?

Because, the first time you access the object, it will be created and
stored in cache

 

 

 

________________________________

From: Anindya Mukherjee [mailto:anindya.mukherjee@gmail.com] 
Sent: Wednesday, July 15, 2009 3:28 PM
To: user-java@ibatis.apache.org
Subject: RE: Force cache refresh + precaching

 

Hi Vinaya,

 

Thanks a lot for the help. I actually meant during app load ( when our
application is booting ).

 

-          Anindya

 

From: Vinaya Tirikkovalluru [mailto:vinaya.tirikkovalluru@converge.com] 
Sent: July-16-09 12:41 AM
To: user-java@ibatis.apache.org
Subject: RE: Force cache refresh + precaching

 

Hi,

 

What do you mean by before app load?

 

To forcefully refresh the cache, you can use

 

getSqlMapClient().flushDataCache("sqlmap.queryname");

 

Vinaya

 

________________________________

From: Anindya Mukherjee [mailto:anindya.mukherjee@gmail.com] 
Sent: Wednesday, July 15, 2009 3:06 PM
To: user-java@ibatis.apache.org
Cc: anindya.mukherjee@gmail.com
Subject: Force cache refresh + precaching

 

Hi ,

 

We have started using iBatis caches. To start with we are using an LRU
cache. However we have an issue ,  the underlying tables in our db can
be updated by manual inserts ( it is a shared db used by a number of
apps ).

 

Now we need a mechanism whereby we can forcefully refresh the iBatis
cache. Can anybody help us with this ? Also the ibatis caches are lazy
loading ( it loads on demand ) , is it possible to somehow precache some
data during app load.

 

-          Thanks,

-          Anindya

________________________________

This electronic message is intended only for the use of the
individual(s) or entity(ies) named above and may contain information
which is privileged and/or confidential. If you are not the intended
recipient, be aware that any disclosure, copying, distribution,
dissemination or use of the contents of this message is prohibited. If
you received this message in error, please notify the sender
immediately. 



This electronic message is intended only for the use of the individual(s) or entity(ies) named above and may contain information which is privileged and/or confidential.  If you are not the intended recipient, be aware that any disclosure, copying, distribution, dissemination or use of the contents of this message is prohibited.  If you received this message in error, please notify the sender immediately.

RE: Force cache refresh + precaching

Posted by Anindya Mukherjee <an...@gmail.com>.
Hi Vinaya,

 

Thanks a lot for the help. I actually meant during app load ( when our
application is booting ).

 

-          Anindya

 

From: Vinaya Tirikkovalluru [mailto:vinaya.tirikkovalluru@converge.com] 
Sent: July-16-09 12:41 AM
To: user-java@ibatis.apache.org
Subject: RE: Force cache refresh + precaching

 

Hi,

 

What do you mean by before app load?

 

To forcefully refresh the cache, you can use

 

getSqlMapClient().flushDataCache("sqlmap.queryname");

 

Vinaya

 

  _____  

From: Anindya Mukherjee [mailto:anindya.mukherjee@gmail.com] 
Sent: Wednesday, July 15, 2009 3:06 PM
To: user-java@ibatis.apache.org
Cc: anindya.mukherjee@gmail.com
Subject: Force cache refresh + precaching

 

Hi ,

 

We have started using iBatis caches. To start with we are using an LRU
cache. However we have an issue ,  the underlying tables in our db can be
updated by manual inserts ( it is a shared db used by a number of apps ).

 

Now we need a mechanism whereby we can forcefully refresh the iBatis cache.
Can anybody help us with this ? Also the ibatis caches are lazy loading ( it
loads on demand ) , is it possible to somehow precache some data during app
load.

 

-          Thanks,

-          Anindya

  _____  

This electronic message is intended only for the use of the individual(s) or
entity(ies) named above and may contain information which is privileged
and/or confidential. If you are not the intended recipient, be aware that
any disclosure, copying, distribution, dissemination or use of the contents
of this message is prohibited. If you received this message in error, please
notify the sender immediately. 


RE: Force cache refresh + precaching

Posted by Vinaya Tirikkovalluru <vi...@converge.com>.
Hi,

 

What do you mean by before app load?

 

To forcefully refresh the cache, you can use

 

getSqlMapClient().flushDataCache("sqlmap.queryname");

 

Vinaya

 

________________________________

From: Anindya Mukherjee [mailto:anindya.mukherjee@gmail.com] 
Sent: Wednesday, July 15, 2009 3:06 PM
To: user-java@ibatis.apache.org
Cc: anindya.mukherjee@gmail.com
Subject: Force cache refresh + precaching

 

Hi ,

 

We have started using iBatis caches. To start with we are using an LRU
cache. However we have an issue ,  the underlying tables in our db can
be updated by manual inserts ( it is a shared db used by a number of
apps ).

 

Now we need a mechanism whereby we can forcefully refresh the iBatis
cache. Can anybody help us with this ? Also the ibatis caches are lazy
loading ( it loads on demand ) , is it possible to somehow precache some
data during app load.

 

-          Thanks,

-          Anindya



This electronic message is intended only for the use of the individual(s) or entity(ies) named above and may contain information which is privileged and/or confidential.  If you are not the intended recipient, be aware that any disclosure, copying, distribution, dissemination or use of the contents of this message is prohibited.  If you received this message in error, please notify the sender immediately.