|
|||||||||
| Home >> All >> org >> [ hsqldb overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.hsqldb
Class Database.Logger

java.lang.Objectorg.hsqldb.Database.Logger
- Enclosing class:
- Database
- class Database.Logger
- extends java.lang.Object
Transitional interface for log and cache management. In future, this will form the basis for the public interface of logging and cache classes.
Implements a storage manager wrapper that provides a consitent, always available interface to storage management for the Database class, despite the fact not all Database objects actually use file storage.
The Logger class makes it possible avoid the necessity to test for a null Log Database attribute again and again, in many different places, and generally avoids tight coupling between Database and Log, opening the doors for multiple logs/caches in the future. In this way, the Database class does not need to know the details of the Logging/Cache implementation, lowering its breakability factor and promoting long-term code flexibility.
| Field Summary | |
private Log |
lLog
The Log object this Logger object wraps |
| Constructor Summary | |
(package private) |
Database.Logger()
|
| Method Summary | |
private void |
checkpoint()
Checkpoints the database. |
(package private) void |
cleanUp()
Releases any cached data rows above the maximum set for any Cache objects existing within the context of this logger. |
(package private) void |
closeLog(int closemode)
Shuts down the logging process using the specified mode. |
(package private) void |
closeTextCache(java.lang.String name)
Closes the TextCache object if a Log object exists. |
(package private) Cache |
getCache()
Returns the Cache object or null if one doesn't exist. |
(package private) boolean |
hasLog()
Determines if the logging process actually does anything. |
(package private) void |
logConnectUser(Session session,
java.lang.String username,
java.lang.String password)
Records a Log entry representing a new connection action on the specified Session object. |
(package private) boolean |
openLog(Database db,
Session sys,
java.lang.String name)
Opens the specified Database object's database files and starts up the logging process. |
(package private) Cache |
openTextCache(java.lang.String table,
java.lang.String source,
boolean readOnlyData,
boolean reversed)
Opens the TextCache object if a Log object exists. |
(package private) void |
setLogSize(int i)
Sets the maximum size to which the log file can grow before being automatically checkpointed. |
(package private) void |
setWriteDelay(boolean delay)
Sets the log write delay mode on or off. |
(package private) void |
writeToLog(Session session,
java.lang.String statement)
Records a Log entry for the specified SQL statement, on behalf of the specified Session object. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
lLog
private Log lLog
- The Log object this Logger object wraps
| Constructor Detail |
Database.Logger
Database.Logger()
| Method Detail |
openLog
boolean openLog(Database db, Session sys, java.lang.String name) throws java.sql.SQLException
- Opens the specified Database object's database files and starts up
the logging process.
If the specified Database object is a new database, its database files are first created.
closeLog
void closeLog(int closemode)
throws java.sql.SQLException
- Shuts down the logging process using the specified mode.
hasLog
boolean hasLog()
- Determines if the logging process actually does anything.
In-memory Database objects do not need to log anything. This method is essentially equivalent to testing whether this logger's database is an in-memory mode database.
getCache
Cache getCache() throws java.sql.SQLException
- Returns the Cache object or null if one doesn't exist.
cleanUp
void cleanUp()
throws java.sql.SQLException
- Releases any cached data rows above the maximum set for any Cache
objects existing within the context of this logger.
logConnectUser
void logConnectUser(Session session, java.lang.String username, java.lang.String password) throws java.sql.SQLException
- Records a Log entry representing a new connection action on the
specified Session object.
writeToLog
void writeToLog(Session session, java.lang.String statement) throws java.sql.SQLException
- Records a Log entry for the specified SQL statement, on behalf of
the specified Session object.
checkpoint
private void checkpoint()
throws java.sql.SQLException
- Checkpoints the database.
The most important effect of calling this method is to cause the log file to be rewritten in the most efficient form to reflect the current state of the database, i.e. only the DDL and insert DML required to recreate the database in its present state. Other house-keeping duties are performed w.r.t. other database files, in order to ensure as much as possible the ACID properites of the database.
setLogSize
void setLogSize(int i)
- Sets the maximum size to which the log file can grow
before being automatically checkpointed.
setWriteDelay
void setWriteDelay(boolean delay)
- Sets the log write delay mode on or off. When write delay mode is
switched on, the strategy is that executed commands are written to
the log at most 1 second after they are executed. This may
improve performance for applications that execute a large number
of short running statements in a short period of time, but risks
failing to log some possibly large number of statements in the
event of a crash. When switched off, the strategy is that all SQL
commands are written to the log immediately after they
are executed, resulting in possibly slower execution but with the
maximum risk being the loss of at most one statement in the event
of a crash.
openTextCache
Cache openTextCache(java.lang.String table, java.lang.String source, boolean readOnlyData, boolean reversed) throws java.sql.SQLException
- Opens the TextCache object if a Log object exists.
closeTextCache
void closeTextCache(java.lang.String name) throws java.sql.SQLException
- Closes the TextCache object if a Log object exists.
|
|||||||||
| Home >> All >> org >> [ hsqldb overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
org.hsqldb.Database.Logger