getTotalCount not work!

Hello!

How can I get record count returned by query to my tamino db? I tried to use getTotalCount method of TaminoResult class by it doesn’t work properly. In documentation I found:

"
public int getTotalCount()
This returns the total number of elements. Note: From Tamino Version 2.1 onwards, the return value will become increasingly unreliable.
Returns:
0-n"

It means that I should not use getTotalCount()? So it is other posibility to return record count?

Please help me!

Any help will be very appreciated!

Thanks a lot in advance!

best regards,
Dariusz Baumann

Hi Dariusz,

I believe that the current best-practice is to do a “count query” to find the number of results.

Cheers,
Trevor.

Why should I execute two queries to my tamino db to:
1) get data
2) get record count?

Is it impossible to get these information in ONE query?

Thanks in advance!

best regards,
Dariusz Baumann

A couple of remarks.
1. The getTotalCount() has been removed, because the value was unreliable.
2. Your complain is ok and you are not the only one to mention it.
3. We are thinking about a new solution, which then might be available with the next Tamino XML Server version. Not finally decided yet!
4. If we do a new solution, it will be based on the new cursoring, which is not supported in the HTTP Client API for Java (TaminoClient). It will be available in the Tamino API for Java (TaminoAPI4J).