*/
public final BasePage findpage(Transaction xact) throws StandardException
{
releaseResource(xact);
RawTransaction rtran = (RawTransaction)xact;
containerHdl = rtran.openDroppedContainer(pageId.getContainerId(),
(LockingPolicy) null);
if (containerHdl == null)
{
throw StandardException.newException(
SQLState.DATA_CONTAINER_VANISHED, pageId.getContainerId());
}
foundHere = true;
// if container is dropped and committed, cannot look at any page,
// it may be a container stub
if (containerHdl.getContainerStatus() == RawContainerHandle.COMMITTED_DROP)
{
releaseResource(xact);
return null;
}
StandardException getPageException = null;
try
{
// get and latch page - we don't know the status of the page or what
// kind of page we are looking for, get any type of page
page = (BasePage)(containerHdl.getAnyPage(pageId.getPageNumber()));
}
catch (StandardException se)
{
getPageException = se;
}
//Try to initialize the page if page not found exception occurs during
//recovery and the page version is zero(Init Page).
//We do this if derby.storage.patchInitPageRecoverError is set.
if (page == null && getPageException != null && pageVersion == 0)
if (PropertyUtil.getSystemBoolean(RawStoreFactory.PATCH_INITPAGE_RECOVER_ERROR))
page = getPageForRedoRecovery(xact);
// maybe we are in rollforward recovery and this is an init page operation,
// give subclass a chance to create the page
if (page == null && getPageException != null)
{
//if are rolloforward recovery reload the page using load tran methods
//that initialize the page. because in rollforward recovery, we
//might be actually recreating the page container did not exist
//in the backup when we started the rollforward recovery.
if (rtran.inRollForwardRecovery())
{
if (SanityManager.DEBUG)
if(SanityManager.DEBUG_ON("LoadTran"))
SanityManager.DEBUG_PRINT(
"Trace", "got null page " + pageId +