Hi,
Actually I want to find different personel cards from PersonelCard table with
its cardNo entity(its actualy unique) for every second. I think if I hold the
PersonelCard table in the cache, this can be increased the performanse and when
I want to find the personel card with its cardNo entity, I use the caches data
for searching and finding the PersonelCard row and its relational objects. So I
think I haven't to do query for finding the each PersonelCard row from the
sql.
In userGuide for caches query advice the following:
performQuery(java.lang.String queryName, boolean refresh)
if refresh is false.
but i don't use the a named query stored in one of the DataMaps.Instead i use
below SelectQuery and i quess
query.setRefreshingObjects(false) indicates that a cached result should be used
if available. Is it correct?
Did you mean setting pagesize for "is CARD_NO indexed". How do I query with
cached data ?
> > Code:
> > Expression qualifier = ExpressionFactory.matchExp(
> > PersonelCard.CARD_NO_PROPERTY, cardNo);
> > SelectQuery query = new SelectQuery(PersonelCard.class,qualifier);
> > query.setDistinct(false);
> > query.setCachePolicy(GenericSelectQuery.SHARED_CACHE);
> > query.setRefreshingObjects(false);
> > query.setFetchingDataRows(true);
> > List cards = context.performQuery(query);
> >
>
>
> I'm with Tore... in this case, DataRows aren't going to do you any
> good. DataRows don't make data queries faster, just object
> construction... and since you're only constructing 1 object....
>
> On the other hand, is CARD_NO indexed? A repeated table scan is
> expensive. Indexes rule. If its not, distinct makes it even worse - I
> would avoid using distinct here, particularly since you're not doing a
> join. Just ignore the second, third, etc results if you only want one.
>
> Finally, why are you running this every second if its cached???
>
> Cris
>
>
This archive was generated by hypermail 2.0.0 : Wed Jan 18 2006 - 04:04:10 EST