public class DBManager extends java.lang.Object implements FixedLoggers
Modifier and Type | Field and Description |
---|---|
static int |
FASTFORWARD |
static int |
FORWARDONLY |
java.lang.ref.ReferenceQueue |
refQue |
static int |
SCROLLINSENSITIVE |
static int |
SCROLLSENSITIVE |
static int |
SCROLLSENSITIVEONE |
boolean |
ssPropLoaded |
java.util.concurrent.ConcurrentLinkedQueue<java.sql.Statement> |
stmtQueue |
APPLOGGER, CRONTASKLOGGER, CRONTASKMGRLOGGER, CRONTASKMGRSQLLOGGER, DBCONNECTIONLOGGER, DDLOGGER, DMLOGGER, EVENTLOGGER, EXCEPTIONLOGGER, MAILLOGGER, MAXIMOLOGGER, MTLOGGER, NULLMBOPOINTER, SECURITY, SENDFAILEDLOGGER, SERVICELOGGER, SQLLOGGER
appenderPrefix, LOGGERNAME_APP, LOGGERNAME_CRONTASK, LOGGERNAME_CRONTASKMGR, LOGGERNAME_DBCONNECTION, LOGGERNAME_DD, LOGGERNAME_DM, LOGGERNAME_DMPREVIEW, LOGGERNAME_EVENT, LOGGERNAME_EXCEPTION, LOGGERNAME_MAIL, LOGGERNAME_MAXIMO, LOGGERNAME_MT, LOGGERNAME_NULLMBOPOINTER, LOGGERNAME_SECURITY, LOGGERNAME_SENDFAILED, LOGGERNAME_SERVICE, LOGGERNAME_SQL, LOGGERNAME_SQL_CRONTASKMGR, LOGGERNAME_TXN, loggerPrefix
Constructor and Description |
---|
DBManager()
Constructs an empty Pool
|
Modifier and Type | Method and Description |
---|---|
void |
cleanupStatementQueue()
Continuesly clean up the statement queue.
|
void |
configure(java.util.Properties properties)
configure the DBManager based on the
information in the properties file read in.
|
void |
destroy()
Closes database connections, set's both the used and free vectors to null
|
void |
finalization()
Continuesly clean up the phantom references for the clean up system resources.
|
void |
finalization(int timeMilli)
Engage in the clean up of the objects in the phantom reference queue for the specified amount of time.
|
void |
flushFreeConnections() |
void |
freeConnection(ConnectionKey conKey) |
void |
freeConnection(ConnectionKeyLight conKey) |
java.sql.Connection |
getConnection(ConnectionKey conKey) |
DBCredentialHandler |
getCredentialHandler() |
java.lang.String |
getDatabaseProductName()
Returns the database product name.
|
java.lang.String |
getDatabaseProductSimpleVersion()
Returns the database product version Major.Minor.
|
java.lang.String |
getDatabaseProductVersion()
Returns the database product version string.
|
static double |
getDB2Version()
If this is a DB2 database, returns the DB2 version, else returns 0.
|
int |
getDBAuthenticationType()
Return the authentication type.
|
int |
getDBConnFree() |
int |
getDBConnTotal() |
int |
getDBConnUsed() |
static int |
getDBPlatform()
Returns the database platform as an integer.
|
static int |
getDbSqlServerDriver()
Returns constant for SqlServer driver.
|
psdi.server.DBManager.Lock |
getLock(java.lang.Object connectionKey) |
java.lang.String |
getName()
Name of the pool a.k.a.
|
java.util.Properties |
getProperties()
properties are the ones handed in to this Pool at construction time.
|
java.lang.ref.ReferenceQueue |
getReferenceQueue()
get the refrence quque.
|
java.lang.String |
getSchemaOwner()
Returns the database schema owner.
|
java.sql.Connection |
getSequenceConnection()
Returns the connection used for generating sequence for sqlserver
This should not be used by any application services
or business objects.
|
static java.lang.String |
getSPID(java.sql.Connection connection)
Get the SPID from database for each connection.Don't use this method directly.
|
static long |
getSQLTimeLimit() |
static int |
getSSCursorType()
Returns cursor type for Sql server.
|
static boolean |
getSSDisableCursor()
Returns if server cursor is disabled or not for Sql server.
|
static int |
getSSFetchSize()
Returns fetch size for Sql server.
|
static boolean |
getSSFetchUse()
Returns if fetch size can be used or not for Sql server.
|
ConnectionKey |
getSystemConnectionKey()
Returns SystemConnectionKey object to use to get System connection.
|
java.util.HashMap<java.lang.Integer,java.lang.Integer> |
getTenantUsedConnCount(UserInfo ui,
java.util.List<java.lang.Integer> allTenants) |
boolean |
init()
Loads a driver, and establishes a series of connections with
the specified database.
|
static java.lang.StringBuffer |
logSQLPlan(java.sql.Connection conn,
java.lang.String sqlStatement) |
static boolean |
needToLogSQLOnTimeLimit() |
static boolean |
needToLogSQLPlan()
Identifies whether we need to log Sql plan (property mxe.db.logSQLPlan).
|
static void |
printStackTraceNoMsg(java.lang.Throwable e)
print out stacktrace of an exception to std err without using maxmessage to avoid deadlock or infinit loop
|
static void |
readSQLTimeLimit() |
void |
reloadDBRefCount() |
void |
reloadDBRowCount() |
static void |
reloadLogSQLPlan()
Reload the cached value we have for property mxe.db.logSQLPlan
when the value of that property has changed.
|
void |
reloadProperties(java.util.Properties props)
This is called from MaxPropCache when reloading properties from maximo.properties file
when WAS fine-grained application update has been used.
|
static void |
reloadSQLScanExclude() |
static void |
reloadSQLTimeLimit() |
static java.util.Vector |
sqlTableScanExclude() |
public static final int FORWARDONLY
public static final int SCROLLINSENSITIVE
public static final int SCROLLSENSITIVE
public static final int SCROLLSENSITIVEONE
public static final int FASTFORWARD
public boolean ssPropLoaded
public java.lang.ref.ReferenceQueue refQue
public java.util.concurrent.ConcurrentLinkedQueue<java.sql.Statement> stmtQueue
public DBManager()
name
- the name of this DBManagerpublic psdi.server.DBManager.Lock getLock(java.lang.Object connectionKey)
public void configure(java.util.Properties properties)
public java.lang.String getSchemaOwner()
public java.util.Properties getProperties()
public java.lang.String getName()
public java.lang.String getDatabaseProductName()
public java.lang.String getDatabaseProductSimpleVersion()
public java.lang.String getDatabaseProductVersion()
public static boolean getSSDisableCursor()
public static boolean getSSFetchUse()
public static int getSSFetchSize()
public static int getSSCursorType()
public static int getDbSqlServerDriver()
public static int getDBPlatform()
UpgConstants
public static double getDB2Version()
public boolean init()
public void destroy()
public java.sql.Connection getConnection(ConnectionKey conKey)
public static void printStackTraceNoMsg(java.lang.Throwable e)
public void freeConnection(ConnectionKey conKey)
public void freeConnection(ConnectionKeyLight conKey)
public ConnectionKey getSystemConnectionKey()
public java.sql.Connection getSequenceConnection()
public int getDBConnTotal()
public int getDBConnUsed()
public int getDBConnFree()
public int getDBAuthenticationType()
public DBCredentialHandler getCredentialHandler()
public static long getSQLTimeLimit()
public static boolean needToLogSQLOnTimeLimit()
public static void reloadSQLTimeLimit()
public static boolean needToLogSQLPlan()
readLogSQLPlan
,
logSQLPlan
public static void reloadLogSQLPlan()
readLogSQLPlan
public static void reloadSQLScanExclude()
public void reloadDBRowCount()
public void reloadDBRefCount()
public void reloadProperties(java.util.Properties props) throws MXException
MXException
public static void readSQLTimeLimit()
public static java.util.Vector sqlTableScanExclude()
public static java.lang.StringBuffer logSQLPlan(java.sql.Connection conn, java.lang.String sqlStatement)
public static java.lang.String getSPID(java.sql.Connection connection)
connection
- java.lang.Exception
public void flushFreeConnections() throws java.rmi.RemoteException
java.rmi.RemoteException
public java.util.HashMap<java.lang.Integer,java.lang.Integer> getTenantUsedConnCount(UserInfo ui, java.util.List<java.lang.Integer> allTenants) throws MXException
MXException
public void finalization() throws java.lang.InterruptedException
java.lang.InterruptedException
public void finalization(int timeMilli) throws java.lang.InterruptedException
max
- java.lang.InterruptedException
public void cleanupStatementQueue() throws java.lang.InterruptedException
java.lang.InterruptedException
public java.lang.ref.ReferenceQueue getReferenceQueue()