VERIFIED SOLUTION i
X

Increasing Vault Java API maxResults

Issue

I would like to remove any limit to the number of documents  the Vault Java API will return and let the application return thousands in the list so I can reprint them in bulk.  Currently I'm getting an error in my API application about too many results.

Cause

By default the Vault Java API call Database.getAllAccounts  will only return a maximum of 100,000 results.  If there are more than 100,000 results you'll get this error message:
 
VaultMain:doSearch()- Error occured....com.g1.e2.vault.TooManyResultsException: Seems there are too many accounts for [db=provider]; please use Database.getAllAccounts(int maxResults), set up maxResults and a bigger value to call setMax4ThrowException() and try again 
 
The error message was thrown because the size of the results were larger than (maxResults*2+max4ThrowException).

The default max4ThrowException is 100,000.

If you set up maxResults=100, the threshold of throwing the exception is 100,200.

Resolution

UPDATED: December 6, 2018


Adjust the value of the maxResults variable to resolve this issue.

Downloads

  • No Downloads