caching issue in retrieving records of an entity.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

caching issue in retrieving records of an entity.

shree-3

Hi all,

I am trying to retrieve records of an entity named "ProductPrice".

The code is as follows.
delegator.findByAndCache("ProductPrice",UtilMisc.toMap("productId", productId));

It is supposed to get all the columns of that entity.
But sometimes ,getting the data of only one column.But after sometimes if I refresh the page or restart the server, it is fetching the complete data without any fail.

So I tested using findByAndCache for 10 newly created products, The sale price was fetched only for  3  products and failed for 7 products.

And then I tested using findByAnd for 10 new products, the sale price was being fetched all the time for all the 10 products.

So I concluded that It was the cache problem.

But i need to use findByAndCache only for better performance.

Can anyone suggest me, what might be causing this problem and how can I solve it .

Regards,
Shree.
Reply | Threaded
Open this post in threaded view
|

Re: caching issue in retrieving records of an entity.

Jacques Le Roux
Administrator
How have you set cache.properties ?
http://docs.ofbiz.org/display/OFBTECH/Apache+OFBiz+Technical+Production+Setup+Guide#ApacheOFBizTechnicalProductionSetupGuide-CacheSettings

Jacques

From: "shree" <[hidden email]>

>
>
> Hi all,
>
> I am trying to retrieve records of an entity named "ProductPrice".
>
> The code is as follows.
> delegator.findByAndCache("ProductPrice",UtilMisc.toMap("productId",
> productId));
>
> It is supposed to get all the columns of that entity.
> But sometimes ,getting the data of only one column.But after sometimes if I
> refresh the page or restart the server, it is fetching the complete data
> without any fail.
>
> So I tested using findByAndCache for 10 newly created products, The sale
> price was fetched only for  3  products and failed for 7 products.
>
> And then I tested using findByAnd for 10 new products, the sale price was
> being fetched all the time for all the 10 products.
>
> So I concluded that It was the cache problem.
>
> But i need to use findByAndCache only for better performance.
>
> Can anyone suggest me, what might be causing this problem and how can I
> solve it .
>
> Regards,
> Shree.
>
> --
> View this message in context: http://www.nabble.com/caching-issue-in-retrieving-records-of-an-entity.-tp16850199p16850199.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>