final DOMFile.RecordPos rec = db.findValuePosition(addr); page = rec.page.getPageNum(); p = rec.page; offset = rec.offset - 2; node = null; } else if (-1 < startAddress) { final DOMFile.RecordPos rec = db.findValuePosition(startAddress); page = rec.page.getPageNum(); offset = rec.offset - 2; p = rec.page; } else if (page > -1) p = db.getCurrentPage(page); else { lock.release(); return false; } db.getPageBuffer().add(p); final DOMFilePageHeader ph = p.getPageHeader(); lock.release(); if (offset < ph.getDataLength()) return true; else if (ph.getNextDataPage() < 0) return false; else return true;
else return true; } else return false;
		public boolean hasNext() {			Lock lock = db.getLock();			try {				try {					lock.acquire();				} catch (LockException e) {					return false;				}				if (node != null) {					db.setOwnerObject(lockKey);					long addr = db.findValue(lockKey, node);					if (addr == BTree.KEY_NOT_FOUND)						return false;					final DOMFile.RecordPos rec = db.findValuePosition(addr);					page = rec.page.getPageNum();					p = rec.page;					offset = rec.offset - 2;					node = null;				} else if (-1 < startAddress) {					final DOMFile.RecordPos rec = db.findValuePosition(startAddress);					page = rec.page.getPageNum();					offset = rec.offset - 2;					p = rec.page;				} else if (page > -1)					p = db.getCurrentPage(page);				else {					lock.release();					return false;				}				db.getPageBuffer().add(p);				final DOMFilePageHeader ph = p.getPageHeader();				lock.release();				if (offset < ph.getDataLength())					return true;				else if (ph.getNextDataPage() < 0)					return false;				else					return true;			} catch (BTreeException e) {				LOG.warn(e);			} catch (IOException e) {				LOG.warn(e);			}			lock.release();			return false;		}