public class JDBCTransaction extends DBTransaction implements JDBCTransactionMBean
AbstractTransaction.Context
Modifier and Type | Field and Description |
---|---|
private String |
connurl |
private String |
dbinit |
private String |
dbname |
static String |
DFLT_JDBC_DB_PREFIX |
private String |
driver |
private String |
host |
static String |
JDBC_CONNECT_RETRY_COUNT_PROP
This property is used to set the number of reconnection attempts after a failure, by default 5.
|
static String |
JDBC_CONNECT_RETRY_DELAY_PROP
This property is used to set the maximum time to attempt to reconnect after a failure, by default 60.000 (60 seconds).
|
static String |
JDBC_DB_CLOSE_PROP
This property is used to define the SQL statement executed at the end of the module, by default none.
|
static String |
JDBC_DB_DELETE_PROP
This property allows to define the SQL statement allowing to delete an entry in the table used by the module,
by default: "DELETE FROM <> WHERE name=?"
|
static String |
JDBC_DB_HOST_PROP
This property allows to define the hostname of the URL used to establish the connection.
|
static String |
JDBC_DB_INIT_PROP
This property allows to define the SQL statement allowing to create the table used by the module, for example:
"CREATE TABLE JoramDB (name VARCHAR(256), content LONG VARCHAR FOR BIT DATA, PRIMARY KEY(name))"
This property can be set only at first launching.
|
static String |
JDBC_DB_INSERT_PROP
This property allows to define the SQL statement allowing to insert an entry in the table used by the module,
by default: "INSERT INTO <> VALUES (?
|
static String |
JDBC_DB_NAME_PROP
This property allows to define the database name of the URL used to establish the connection, by default "JoramDB".
|
static String |
JDBC_DB_PASS_PROP
This property allows to define the password of database user on whose behalf the connection is being made.
|
static String |
JDBC_DB_PORT_PROP
This property allows to define the port of the URL used to establish the connection.
|
static String |
JDBC_DB_PROTOCOL_PROP
This property allows to define the protocol part of the URL used to establish the connection, for example "jdbc:mysql".
|
static String |
JDBC_DB_UPDATE_PROP
This property allows to define the SQL statement allowing to update an entry in the table used by the module,
by default: "UPDATE <> SET content=?
|
static String |
JDBC_DB_USER_PROP
This property allows to define the name of database user on whose behalf the connection is being made.
|
static String |
JDBC_DRIVER_PROP
This property allows to define the class that implements the JDBC driver, for example "com.mysql.jdbc.Driver".
|
static String |
JDBC_PROPS_FILE_PROP
This property allows to define the name of a file containing a list of arbitrary string tag/value pairs as connection
arguments; normally at least a "user" and "password" property should be included.
|
static String |
JDBC_TRANSACTION_PREFIX |
static String |
JDBC_URL_PROP
This property allows to define the database url of the form "jdbc:subprotocol://host:port/dbname".
|
private String |
password |
private String |
path |
private String |
port |
private Properties |
props |
private String |
protocol |
private String |
user |
conn, connectRetryCount, connectRetryDelay, DB_TRANSACTION_PREFIX, dbclose, dbdelete, dbinsert, dbtable, dbupdate, DFLT_TABLE_PREFIX, JDBC_CONNECT_RETRY_COUNT_DFLT, JDBC_CONNECT_RETRY_DELAY_DFLT, TABLE_NAME_PROP
dir, OOS_STREAM_HEADER, perThreadContext, phase, startTime
logmon
Constructor and Description |
---|
JDBCTransaction() |
Modifier and Type | Method and Description |
---|---|
protected void |
connectDB()
This method try to reconnect to the database, it is used in case of failure during commit.
|
Properties |
getClientInfo() |
String |
getDBInitStatement() |
String |
getDBName() |
String |
getDriver() |
String |
getPropertiesPath() |
String |
getURL() |
String |
getUser() |
protected void |
initDB()
Instantiates the database driver and creates the table if necessary
|
close, commit, delete, getBadInserts, getBadUpdates, getCommitBytes, getCommitCount, getDBCloseStatement, getDBDeleteStatement, getDBInsertStatement, getDBTableName, getDBUpdateStatement, getList, getLogThresholdOperation, getNbDeletes, getNbInserts, getNbUpdates, getObject, getObjectList, getPersistenceDir, initRepository, isPersistent, loadByteArray, saveInLog, setPhase, stop
begin, containsOperations, create, create, createByteArray, createByteArray, delete, getOperationCount, getPhase, getPhaseInfo, getStartTime, init, load, load, loadByteArray, release, save, save, save, saveByteArray, saveByteArray, saveByteArray
freeze, getBoolean, getInteger, getInteger, getProperty, getProperty, loadProperties, saveProperties
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getBadInserts, getBadUpdates, getCommitBytes, getDBCloseStatement, getDBDeleteStatement, getDBInsertStatement, getDBTableName, getDBUpdateStatement, getLogThresholdOperation, getNbDeletes, getNbInserts, getNbUpdates, getObject, getObjectList, getPhase, getPhaseInfo
getCommitCount, getStartTime, isPersistent
public static final String JDBC_TRANSACTION_PREFIX
public static final String JDBC_DRIVER_PROP
public static final String JDBC_URL_PROP
public static final String JDBC_DB_PROTOCOL_PROP
public static final String JDBC_DB_HOST_PROP
public static final String JDBC_DB_PORT_PROP
public static final String JDBC_DB_NAME_PROP
public static final String DFLT_JDBC_DB_PREFIX
public static final String JDBC_PROPS_FILE_PROP
public static final String JDBC_DB_USER_PROP
public static final String JDBC_DB_PASS_PROP
public static final String JDBC_CONNECT_RETRY_COUNT_PROP
public static final String JDBC_CONNECT_RETRY_DELAY_PROP
public static final String JDBC_DB_INIT_PROP
public static final String JDBC_DB_INSERT_PROP