private BIN searchForBIN(DatabaseImpl db, byte[] mainKey, byte[] dupKey)
throws DatabaseException {
/* Search for this IN */
Tree tree = db.getTree();
IN in = tree.search
(mainKey, SearchType.NORMAL, -1, null, false /*updateGeneration*/);
/* Couldn't find a bin, return null */
if (in == null) {
return null;