private void runQuery()
{
Visit visit = (Visit) getVisit();
Integer userPK = visit.getUserId();
VirtualLibraryEngine vengine = (VirtualLibraryEngine) getEngine();
SortOrdering ordering = new SortOrdering(getSortColumn(), isDescending());
int i = 0;
while (true)
{
try
{
IBookQuery query = getBorrowedQuery();
if (query == null)
{
query = vengine.createNewQuery();
setBorrowedQuery(query);
}
int count = query.borrowerQuery(userPK, ordering);
if (count != _browser.getResultCount())
_browser.initializeForResultCount(count);
break;
}
catch (RemoteException ex)
{
vengine.rmiFailure("Remote exception finding borrowed books.", ex, i++);
setBorrowedQuery(null);
}
}
}