}
@Override
public boolean create() throws DBException {
if ( super.create() ) {
Transaction tx = new Transaction();
try {
open();
long p = fileHeader.getRootPage();
rootInfo = new BTreeRootInfo(p);
rootNode = new BTreeNode(rootInfo, getPage(tx, p));
rootNode.ph.setStatus(LEAF);
rootNode.setValues(new Value[0]);
rootNode.setPointers(new long[0]);
rootNode.write(tx);
tx.commit();
close();
return true;
}
catch ( DBException e ) {
tx.cancel();
throw e;
}
catch ( Exception e ) {
tx.cancel();
e.printStackTrace(System.err);
throw new FilerException(FaultCodes.COL_CANNOT_CREATE, e);
}
}
return false;