Cosminexus アプリケーションサーバ V8 機能解説 保守/移行/互換編
Cosminexus DABroker Libraryでは,JDBCドライバのトレース情報やスプール情報を取得できます。また,障害発生時には,アプリケーションサーバの定義を取得してください。これらの情報を使用して,障害が発生したときに設定されていた定義内容を確認します。
ここでは,これらの情報を取得するための設定について説明します。
Cosminexus DABroker Libraryでは,スプール情報のほかに次のJDBCドライバのトレースも取得できます。
ただし,これらのトレースを取得するためには,アプリケーション開発時にJDBCドライバのトレース取得のための設定をしておく必要があります。設定方法については,「11.6.4 データベース接続の設定」を参照してください。
Cosminexus DABroker Libraryでは,スプール情報として,メッセージログ,拡張データベースアクセストレース,Exceptionトレースログなどを取得できます。環境設定ユティリティ(Windowsの場合)またはCosminexus DABroker Library動作環境定義ファイル(UNIXの場合)で,メッセージログ,拡張データベースアクセストレースのファイルサイズなどを設定してください。環境設定ユティリティまたはCosminexus DABroker Library動作環境定義ファイルの設定については,Windowsの場合は「11.2.1(3) Cosminexus DABroker Libraryの動作環境の設定」,UNIXの場合は「11.2.2(4) Cosminexus DABroker Libraryの動作環境の設定」を参照してください。
また,Exceptionトレースログを取得するためには,運用開始前に取得のための設定が必要です。ここでは,Exceptionトレースログ取得の設定について説明します。
Exceptionトレースログ取得の設定では,次の内容を設定します。
それぞれの設定方法について説明します。
Exceptionトレースログは,メソッド実行時に,SQLException,BatchUpdateException,またはXAExceptionが発生した場合に出力されます。Exceptionトレースログを出力するメソッドには,メソッドごとにトレース取得レベルが定義されています。出力するトレース取得レベルを指定することで,目的に応じた内容のトレースを出力できるようになります。
| 環境変数名 | 説明 |
|---|---|
| DAB_TRACELEVEL | トレース取得レベルとして,1〜5を指定します。ただし,トレース取得レベル4は現在未使用であり,4が指定された場合は3と同じ動きとなります。
|
表E-1 Exceptionトレースログのトレース取得レベル
| トレース取得レベル | 取得できるログの内容 | 説明 |
|---|---|---|
| 1 |
|
標準のトレース取得レベルです。コネクションとステートメントの状態と実行順序を調査したい場合に指定してください。 |
| 2 |
|
データベースのアクセス要求の状態と実行順序を調査したい場合に指定してください。ソースとログの比較が容易になります。 |
| 3 |
|
XA要求の状態と実行順序を調査したい場合に指定してください。 |
| 5 |
|
内部処理の状態と実行順序を調査したい場合に指定してください。 |
表E-2 Exceptionトレースログを取得するメソッドのトレース取得レベル
| クラス名 | メソッド名 | トレース取得レベル | 備考 |
|---|---|---|---|
| CallableStatement | boolean execute()※1 | 2 | Statementクラス,およびPreparedStatementクラスのメソッドをオーバーライドしたメソッド。 |
| ResultSet executeQuery()※1 | 2 | ||
| int executeUpdate()※1 | 2 | ||
| boolean execute(String sql)※2 | 1 | ||
| int[] executeBatch() | 2 | ||
| ResultSet executeQuery(String sql)※2 | 1 | ||
| int executeUpdate(String sql)※2 | 1 | ||
| Connection | void close() | 1 | − |
| void commit() | 2 | − | |
| Statement createStatement()※1 | 1 | − | |
| Statement createStatement(int resultSetType, int resultSetConcurrency)※2 | 1 | − | |
| DatabaseMetaData getMetaData() | 2 | − | |
| CallableStatement prepareCall(String sql)※1 | 1 | − | |
| CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency)※2 | 1 | − | |
| PreparedStatement prepareStatement(String sql)※1 | 1 | − | |
| PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency)※2 | 1 | − | |
| void rollback() | 2 | − | |
| void setAutoCommit(boolean autoCommit) | 2 | − | |
| DatabaseMetaData | ResultSet getBestRowIdentifier(String catalog, String schema, String table, int scope, boolean nullable) | 2 | − |
| ResultSet getCatalogs() | 2 | − | |
| ResultSet getColumnPrivileges(String catalog, String schema, String table, String columnNamePattern) | 2 | − | |
| ResultSet getColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) | 2 | − | |
| Connection getConnection() | 2 | − | |
| ResultSet getCrossReference(String primaryCatalog, String primarySchema, String primaryTable, String foreignCatalog, String foreignSchema, String foreignTable) | 2 | − | |
| ResultSet getExportedKeys(String catalog, String schema, String table) | 2 | − | |
| ResultSet getImportedKeys(String catalog, String schema, String table) | 2 | − | |
| ResultSet getIndexInfo(String catalog, String schema, String table, boolean unique, boolean approximate) | 2 | − | |
| ResultSet getPrimaryKeys(String catalog, String schema, String table) | 2 | − | |
| ResultSet getProcedureColumns(String catalog, String schemaPattern, String procedureNamePattern, String columnNamePattern) | 2 | − | |
| ResultSet getProcedures(String catalog, String schemaPattern, String procedureNamePattern) | 2 | − | |
| ResultSet getSchemas() | 2 | − | |
| ResultSet getTablePrivileges(String catalog, String schemaPattern, String tableNamePattern) | 2 | − | |
| ResultSet getTables(String catalog, String schemaPattern, String tableNamePattern, String[] types) | 2 | − | |
| ResultSet getTableTypes() | 2 | − | |
| ResultSet getTypeInfo() | 2 | − | |
| ResultSet getUDTs(String catalog, String schemaPattern, String typeNamePattern, int[] types) | 2 | − | |
| ResultSet getVersionColumns(String catalog, String schema, String table) | 2 | − | |
| Driver | Connection connect(String url, Properties info) | 1 | − |
| PreparedStatement | boolean execute()※1 | 2 | − |
| ResultSet executeQuery()※1 | 2 | − | |
| int executeUpdate()※1 | 2 | − | |
| ResultSetMetaData getMetaData() | 2 | − | |
| boolean execute(String sql)※2 | 1 | Statementクラスのメソッドをオーバーライドしたメソッド。 | |
| int[] executeBatch() | 2 | ||
| ResultSet executeQuery(String sql)※2 | 1 | ||
| int executeUpdate(String sql)※2 | 1 | ||
| ResultSet | boolean absolute(int row) | 2 | データベースにアクセスするときだけ取得します。 |
| void afterLast() | 2 | ||
| void beforeFirst() | 2 | ||
| void close() | 2 | − | |
| boolean first() | 2 | データベースにアクセスするときだけ取得します。 | |
| ResultSetMetaData getMetaData() | 2 | − | |
| Statement getStatement() | 2 | − | |
| boolean last() | 2 | データベースにアクセスするときだけ取得します。 | |
| boolean next() | 2 | ||
| boolean relative(int rows) | 2 | ||
| Statement | void cancel() | 2 | − |
| void close() | 1 | − | |
| boolean execute(String sql) | 1 | − | |
| int[] executeBatch() | 2 | − | |
| ResultSet executeQuery(String sql) | 1 | − | |
| int executeUpdate(String sql) | 1 | − | |
| ResultSet getResultSet() | 2 | − | |
| DataSource | Connection getConnection()※1 | 1 | − |
| Connection getConnection(String username, String password)※2 | 1 | − | |
| PooledConnection | void close() | 1 | − |
| Connection getConnection() | 1 | − | |
| ConnectionPoolDataSource | PooledConnection getPooledConnection()※1 | 1 | − |
| PooledConnection getPooledConnection(String username, String password) ※2 | 1 | − | |
| XAConnection | XAResource getXAResource() | 1 | − |
| XADataSource | XAConnection getXAConnection()※1 | 1 | − |
| XAConnection getXAConnection(String user, String password)※2 | 1 | − | |
| XAResource | void commit(Xid xid, boolean onePhase) | 3 | − |
| void end(Xid xid, int flags) | 3 | − | |
| void forget(Xid xid) | 3 | − | |
| boolean isSameRM(XAResource xares) | 3 | − | |
| int prepare(Xid xid) | 3 | − | |
| Xid[] recover(int flag) | 3 | − | |
| void rollback(Xid xid) | 3 | − | |
| void start(Xid xid, int flags) | 3 | − |
(凡例)−:該当しない
注※1 メソッド名は,「メソッド名(1)」と出力されます。
注※2 メソッド名は,「メソッド名(2)」と出力されます。
Exceptionトレースログを出力するファイルの出力先を設定できます。
| 環境変数名 | 説明 |
|---|---|
| DAB_FILEDIR | Exceptionトレースログの出力先のディレクトリを絶対パスで指定します。
|
Exceptionトレースログを出力するファイルの出力情報量を設定できます。
| 環境変数名 | 説明 |
|---|---|
| DAB_FILEOUTNUM | ファイル出力情報量として,メモリ内取得情報をファイルに出力する回数の上限を指定します。指定できる範囲は,1〜50です。
|
情報量の上限=(DAB_ONMEMNUMの指定値)×(DAB_FILEOUTNUMの指定値)
出力するファイルサイズ=2×メモリ内取得情報量(DAB_ONMEMNUMの指定値)×ファイル出力情報量(DAB_FILEOUTNUMの指定値)×2
Exceptionトレースログを出力するファイルのメモリ内取得情報量を設定できます。
| 環境変数名 | 説明 |
|---|---|
| DAB_ONMEMNUM | メモリ内取得情報量として,メモリ内で保持する情報量の上限を指定します。指定できる範囲は500〜10,000(単位は,行※)です。
|
注※ 1行とは,メソッドの呼び出し情報,メソッドの戻り情報,およびException情報のそれぞれで一度に取得する情報のことです。
メモリ所要量=2×メモリ内取得情報量(DAB_ONMEMNUMの指定値)
トラブルが発生した際に,次のファイルを取得するようにしてください。
トラブルシューティング用に保存するファイルからは,パスワードなどの公開できない情報を削除することをお勧めします。
All Rights Reserved. Copyright (C) 2008, 2011, Hitachi, Ltd.