| java.lang.Object org.hsqldb.DatabaseManager
DatabaseManager | public class DatabaseManager (Code) | | Handles initial attempts to connect to HSQLDB databases within the JVM
(or a classloader within the JVM). Opens the database if it is not open
or connects to it if it is already open. This allows the same database to
be used by different instances of Server and by direct connections.
Maintains a map of Server instances and notifies each server when its
database has shut down.
Maintains a reference to the timer used for file locks and logging.
author: fredt@users version: 1.8.0 since: 1.7.2 |
Method Summary | |
public static void | closeDatabases(int mode) | static void | deRegisterServer(Server server) Deregisters a server completely. | static int | getDatabase(String type, String path, Server server, HsqlProperties props) | static Database | getDatabase(String type, String path, HsqlProperties props) This has to be improved once a threading model is in place.
Current behaviour:
Attempts to connect to different databases do not block. | public static Vector | getDatabaseURIs() Returns a vector containing the URI (type + path) for all the databases. | static Session | getSession(int dbId, int sessionId) Returns an existing session. | public static HsqlTimer | getTimer() | static boolean | isServerDB(Database db) | static Session | newSession(int dbID, String user, String password) | public static Session | newSession(String type, String path, String user, String password, HsqlProperties props) | static void | removeDatabase(Database database) Removes the database from registry. |
databaseIDMap | final static IntKeyHashMap databaseIDMap(Code) | | id number to Database for Databases currently in registry
|
fileDatabaseMap | final static HashMap fileDatabaseMap(Code) | | File to Database mapping for file: databases
|
memDatabaseMap | final static HashMap memDatabaseMap(Code) | | name to Database mapping for mem: databases
|
resDatabaseMap | final static HashMap resDatabaseMap(Code) | | File to Database mapping for res: databases
|
serverMap | static HashMap serverMap(Code) | | Maintains a map of servers to sets of databases.
Servers register each of their databases.
When a database is shutdown, all the servers accessing it are notified.
The database is then removed form the sets for all servers and the
servers that have no other database are removed from the map.
|
closeDatabases | public static void closeDatabases(int mode)(Code) | | Closes all the databases using the given mode.
CLOSEMODE_IMMEDIATELY = -1;
CLOSEMODE_NORMAL = 0;
CLOSEMODE_COMPACT = 1;
CLOSEMODE_SCRIPT = 2;
|
deRegisterServer | static void deRegisterServer(Server server)(Code) | | Deregisters a server completely.
|
getDatabase | static Database getDatabase(String type, String path, HsqlProperties props) throws HsqlException(Code) | | This has to be improved once a threading model is in place.
Current behaviour:
Attempts to connect to different databases do not block. Two db's can
open simultaneously.
Attempts to connect to a db while it is opening or closing will block
until the db is open or closed. At this point the db state is either
DATABASE_ONLINE (after db.open() has returned) which allows a new
connection to be made, or the state is DATABASE_SHUTDOWN which means
the db can be reopened for the new connection).
|
getDatabaseURIs | public static Vector getDatabaseURIs()(Code) | | Returns a vector containing the URI (type + path) for all the databases.
|
getSession | static Session getSession(int dbId, int sessionId)(Code) | | Returns an existing session. Used with repeat HTTP connections
belonging to the same JDBC Conenction / HSQL Session pair.
|
removeDatabase | static void removeDatabase(Database database)(Code) | | Removes the database from registry.
|
|
|