*/
public synchronized void open() throws SqlJetException {
if (!open) {
dbHandle = new SqlJetDbHandle();
dbHandle.setBusyHandler(new SqlJetDefaultBusyHandler());
btree = new SqlJetBtree();
final Set<SqlJetBtreeFlags> flags = (writable ? WRITE_FLAGS : READ_FLAGS);
final Set<SqlJetFileOpenPermission> permissions = (writable ? WRITE_PREMISSIONS : READ_PERMISSIONS);
final SqlJetFileType type = (file != null ? SqlJetFileType.MAIN_DB : SqlJetFileType.TEMP_DB);
btree.open(file, dbHandle, flags, type, permissions);
// force readonly.