You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by "brian.fed7" <br...@gmail.com> on 2010/09/20 19:51:03 UTC

Data Caching using OpenJPA

I am newbie to OpenJPA and have couple of questions on how to implement Data
Caching using OpenJPA

Here is our application requirement. Basically ours is web based j2ee
application that uses JSF,Spring,OpenJPA and Oracle database. In our
application UI screens we have a search screen where if the user enters a
few letters of "code" then the matching codes need to be picked from the
"CODES" table and shown in the UI. The CODES table holds 200,000 records. We
do not want to hit the CODES database table for searching this table
whenever the user enters few characters in the UI screen since the
application response times will be higher if we do it that way instead we
want to cache all the 200,000 records records using Caching functionality
provided by JPA and OpenJPA and increase the application response times so
that it does not take more than 10 seconds or so whenever users enters few
letters of "code" in the UI screen then the search is performed on the
"codes" (all the 200,000) data that is cached rather than hitting the
database for each few letters typed in the UI screen. 

First of all, is my understanding correct that for the above mentioned my
application requirement that I can use Data Caching functionality provided
by OpenJPA. If so, could you please point me to good hands-on tutorials so
that I can quickly implement Data Caching using OpenJPA in my application.

Appreciate your timely help.
-- 
View this message in context: http://openjpa.208410.n2.nabble.com/Data-Caching-using-OpenJPA-tp5551542p5551542.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: Data Caching using OpenJPA

Posted by Rick Curtis <cu...@gmail.com>.
So it sounds like you have some sort of ajax auto complete search field?

If that is the case, this is going to need to be a combination of
openjpa.QueryCache and openjpa.DataCache I believe. I'd suggest reading
through the docs[1]  and creating a small sample before you try to use all
200K items. The properties you'll need to set to get the cache going are:
[openjpa.DataCache=true , openjpa.QueryCache=true].

HTH

Thanks,
Rick

[1]
http://openjpa.apache.org/builds/latest/docs/manual/manual.html#ref_guide_cache_conf

On Mon, Sep 20, 2010 at 12:51 PM, brian.fed7 <br...@gmail.com> wrote:

>
> I am newbie to OpenJPA and have couple of questions on how to implement
> Data
> Caching using OpenJPA
>
> Here is our application requirement. Basically ours is web based j2ee
> application that uses JSF,Spring,OpenJPA and Oracle database. In our
> application UI screens we have a search screen where if the user enters a
> few letters of "code" then the matching codes need to be picked from the
> "CODES" table and shown in the UI. The CODES table holds 200,000 records.
> We
> do not want to hit the CODES database table for searching this table
> whenever the user enters few characters in the UI screen since the
> application response times will be higher if we do it that way instead we
> want to cache all the 200,000 records records using Caching functionality
> provided by JPA and OpenJPA and increase the application response times so
> that it does not take more than 10 seconds or so whenever users enters few
> letters of "code" in the UI screen then the search is performed on the
> "codes" (all the 200,000) data that is cached rather than hitting the
> database for each few letters typed in the UI screen.
>