try {
Database db = session.getDatabase("", "imdb/movies.nsf");
// db.setDelayUpdates(true);
marktime = System.nanoTime();
timelog("Beginning view build...");
View byLength = db.getView("byLength");
View btitles = db.createView("BTitles", "@Begins(Title; \"B\")", byLength);
// View btitles = db.createView("BTitles", "@Begins(Title; \"B\")");
ViewColumn length = btitles.createColumn(1, "Title", "Title");
length.setSorted(true);
timelog("View defined.");
btitles.refresh();
timelog("Completed view build.");
ViewEntryCollection vec = btitles.getAllEntries();
int count = vec.getCount();
timelog("Found " + count + " documents in the view");
btitles.remove();
timelog("Removed view.");
btitles.recycle();
db.recycle();
} catch (Throwable t) {
t.printStackTrace();
} finally {
long testEndTime = System.nanoTime();