Class TsurugiSessionTxLogger
- java.lang.Object
-
- com.tsurugidb.iceaxe.session.event.logging.TsurugiSessionTxLogger
-
- All Implemented Interfaces:
TsurugiSessionEventListener
- Direct Known Subclasses:
TsurugiSessionTxFileLogger
public class TsurugiSessionTxLogger extends java.lang.Object implements TsurugiSessionEventListener
Tsurugi transaction logger.
-
-
Constructor Summary
Constructors Constructor Description TsurugiSessionTxLogger()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidcloseSession(TsurugiSession session, long timeoutNanos, java.lang.Throwable occurred)called when close session.<P,R>
voidcreateQuery(TsurugiSqlPreparedQuery<P,R> ps)called when create prepared query.<R> voidcreateQuery(TsurugiSqlQuery<R> ps)called when create query.<P> voidcreateStatement(TsurugiSqlPreparedStatement<P> ps)called when create prepared statement.voidcreateStatement(TsurugiSqlStatement ps)called when create statement.protected TgSessionTmLogcreateTmLog()Creates a new transaction manager execute log.voidcreateTransaction(TsurugiTransaction transaction)called when create transaction.voidcreateTransactionManager(TsurugiTransactionManager tm)called when create transaction manager.protected TgSessionTxLogcreateTxLog()Creates a new transaction log instance.protected voiddoLogSqlClose(TsurugiTransaction transaction, TsurugiSqlResult result, java.lang.Throwable occurred)do SQL result close.protected voiddoLogSqlEnd(TsurugiTransaction transaction, TsurugiSqlResult result, java.lang.Throwable occurred)do SQL execute end.protected <R> voiddoLogSqlRead(TsurugiTransaction transaction, TsurugiQueryResult<R> result, R record)do SQL read.protected <R> voiddoLogSqlReadException(TsurugiTransaction transaction, TsurugiQueryResult<R> result, java.lang.Throwable occurred)do SQL read error.protected voiddoLogSqlStart(TsurugiTransaction transaction, int iceaxeSqlExecuteId, TsurugiSql ps, java.lang.Object parameter)do SQL start.protected voiddoLogSqlStarted(TsurugiTransaction transaction, TsurugiSqlResult result)do SQL execute started.protected voiddoLogSqlStartException(TsurugiTransaction transaction, int iceaxeSqlExecuteId, java.lang.Throwable occurred)do SQL execute start error.protected voiddoLogTmExecuteEnd(int iceaxeTmExecuteId, TsurugiTransaction transaction, boolean committed, java.lang.Object returnValue, java.lang.Throwable occurred)do transactionManager execute end.protected voiddoLogTmExecuteException(TsurugiTransaction transaction, java.lang.Throwable occurred)do transactionManager execute error.protected voiddoLogTmExecuteRetry(TsurugiTransaction transaction, java.lang.Exception cause, TgTmTxOption nextTmOption)do transactionManager execute retry.protected voiddoLogTmExecuteStart(int iceaxeTmExecuteId)do transactionManager execute start.protected voiddoLogTransactionClose(TsurugiTransaction transaction, java.lang.Throwable occurred)do transaction close.protected voiddoLogTransactionCommitEnd(TsurugiTransaction transaction, TgCommitOption commitOption, java.lang.Throwable occurred)do commit end.protected voiddoLogTransactionCommitStart(TsurugiTransaction transaction, TgCommitOption commitOption)do commit start.protected voiddoLogTransactionRollbackEnd(TsurugiTransaction transaction, java.lang.Throwable occurred)do rollback end.protected voiddoLogTransactionRollbackStart(TsurugiTransaction transaction)do rollback start.protected voiddoLogTransactionSqlEnd(TsurugiTransaction transaction, TsurugiTransaction.TgTxMethod method, int iceaxeTxExecuteId, TsurugiSql ps, java.lang.Object parameter, TsurugiSqlResult result, java.lang.Throwable occurred)do execute SQL end.protected voiddoLogTransactionSqlStart(TsurugiTransaction transaction, TsurugiTransaction.TgTxMethod method, int iceaxeTxExecuteId, TsurugiSql ps, java.lang.Object parameter)do execute SQL start.protected voiddoLogTransactionStart(TsurugiTransaction transaction, java.time.ZonedDateTime startTime)do transaction start.protected voiddoLowTransactionGetEnd(TsurugiTransaction transaction, java.lang.String transactionId, java.lang.Throwable occurred)do get transactionId.protected voiddoLowTransactionGetStart(TsurugiTransaction transaction)do get transactionId.protected TgSessionTmLoggetTmLog(int iceaxeTmExecuteId)get transaction manager execute log.protected TgSessionTxLoggetTxLog(TsurugiTransaction transaction)get transaction log.protected voidlogCreateSqlStatement(TsurugiSql ps)called when create SQL definition.protected voidlogLowTransactionGetEnd(TgSessionTxLog txLog, java.lang.String transactionId, java.lang.Throwable occurred)called when get transactionId.protected voidlogLowTransactionGetStart(TgSessionTxLog txLog)called when get transactionId.protected voidlogSessionClose(TsurugiSession session, java.lang.Throwable occurred)called when close session.protected voidlogSessionShutdown(TsurugiSession session, TgSessionShutdownType shutdownType, java.lang.Throwable occurred)called when shutdown session.protected voidlogSqlClose(TgSessionTxLog txLog, TgSessionSqlLog sqlLog, java.lang.Throwable occurred)called when SQL result close.protected voidlogSqlEnd(TgSessionTxLog txLog, TgSessionSqlLog sqlLog, java.lang.Throwable occurred)called when SQL execute end.protected <R> voidlogSqlRead(TgSessionTxLog txLog, TgSessionSqlLog sqlLog, TsurugiQueryResult<R> result, R record)called when SQL read.protected <R> voidlogSqlReadException(TgSessionTxLog txLog, TgSessionSqlLog sqlLog, TsurugiQueryResult<R> result, java.lang.Throwable occurred)called when occurs exception SQL read.protected voidlogSqlStart(TgSessionTxLog txLog, TgSessionSqlLog sqlLog)called when SQL execute start.protected voidlogSqlStarted(TgSessionTxLog txLog, TgSessionSqlLog sqlLog)called when SQL execute started.protected voidlogSqlStartException(TgSessionTxLog txLog, TgSessionSqlLog sqlLog, java.lang.Throwable occurred)called when occurs exception SQL execute start.protected voidlogTmExecuteEnd(TgSessionTmLog tmLog, java.lang.Throwable occurred)called when transactionManager execute end.protected voidlogTmExecuteException(TgSessionTxLog txLog, java.lang.Throwable occurred)called when occurs transactionManager execute error.protected voidlogTmExecuteRetry(TgSessionTxLog txLog, java.lang.Exception cause, TgTmTxOption nextTmOption)called when transactionManager execute retry.protected voidlogTmExecuteStart(TgSessionTmLog tmLog)called when transactionManager execute start.protected voidlogTransactionClose(TgSessionTxLog txLog, java.lang.Throwable occurred)called when transaction close.protected voidlogTransactionCommitEnd(TgSessionTxLog txLog, TgCommitOption commitOption, java.lang.Throwable occurred)called when commit end.protected voidlogTransactionCommitEnd(TgSessionTxLog txLog, TgCommitType commitType, java.lang.Throwable occurred)Deprecated, for removal: This API element is subject to removal in a future version.protected voidlogTransactionCommitStart(TgSessionTxLog txLog, TgCommitOption commitOption)called when commit start.protected voidlogTransactionCommitStart(TgSessionTxLog txLog, TgCommitType commitType)Deprecated, for removal: This API element is subject to removal in a future version.protected voidlogTransactionRollbackEnd(TgSessionTxLog txLog, java.lang.Throwable occurred)called when rollback end.protected voidlogTransactionRollbackStart(TgSessionTxLog txLog)called when rollback start.protected voidlogTransactionSqlEnd(TsurugiTransaction.TgTxMethod method, TgSessionTxLog txLog, TgSessionTxLog.TgSessionTxExecuteLog exLog, TsurugiSql ps, java.lang.Object parameter, TsurugiSqlResult result, java.lang.Throwable occurred)called when execute SQL end.protected voidlogTransactionSqlStart(TsurugiTransaction.TgTxMethod method, TgSessionTxLog txLog, TgSessionTxLog.TgSessionTxExecuteLog exLog, TsurugiSql ps, java.lang.Object parameter)called when execute SQL start.protected voidlogTransactionStart(TgSessionTxLog txLog)called when transaction start.voidshutdownSession(TsurugiSession session, TgSessionShutdownType shutdownType, long timeoutNanos, java.lang.Throwable occurred)called when shutdown session.
-
-
-
Method Detail
-
createQuery
public final <R> void createQuery(TsurugiSqlQuery<R> ps)
Description copied from interface:TsurugiSessionEventListenercalled when create query.- Specified by:
createQueryin interfaceTsurugiSessionEventListener- Type Parameters:
R- result type- Parameters:
ps- query
-
createQuery
public final <P,R> void createQuery(TsurugiSqlPreparedQuery<P,R> ps)
Description copied from interface:TsurugiSessionEventListenercalled when create prepared query.- Specified by:
createQueryin interfaceTsurugiSessionEventListener- Type Parameters:
P- parameter typeR- result type- Parameters:
ps- query
-
createStatement
public final void createStatement(TsurugiSqlStatement ps)
Description copied from interface:TsurugiSessionEventListenercalled when create statement.- Specified by:
createStatementin interfaceTsurugiSessionEventListener- Parameters:
ps- statement
-
createStatement
public final <P> void createStatement(TsurugiSqlPreparedStatement<P> ps)
Description copied from interface:TsurugiSessionEventListenercalled when create prepared statement.- Specified by:
createStatementin interfaceTsurugiSessionEventListener- Type Parameters:
P- parameter type- Parameters:
ps- statement
-
createTransactionManager
public final void createTransactionManager(TsurugiTransactionManager tm)
Description copied from interface:TsurugiSessionEventListenercalled when create transaction manager.- Specified by:
createTransactionManagerin interfaceTsurugiSessionEventListener- Parameters:
tm- transaction manager
-
createTransaction
public final void createTransaction(TsurugiTransaction transaction)
Description copied from interface:TsurugiSessionEventListenercalled when create transaction.- Specified by:
createTransactionin interfaceTsurugiSessionEventListener- Parameters:
transaction- transaction
-
shutdownSession
public final void shutdownSession(TsurugiSession session, TgSessionShutdownType shutdownType, long timeoutNanos, @Nullable java.lang.Throwable occurred)
Description copied from interface:TsurugiSessionEventListenercalled when shutdown session.- Specified by:
shutdownSessionin interfaceTsurugiSessionEventListener- Parameters:
session- sessionshutdownType- shutdown typetimeoutNanos- shutdown timeoutoccurred- exception
-
closeSession
public final void closeSession(TsurugiSession session, long timeoutNanos, @Nullable java.lang.Throwable occurred)
Description copied from interface:TsurugiSessionEventListenercalled when close session.- Specified by:
closeSessionin interfaceTsurugiSessionEventListener- Parameters:
session- sessiontimeoutNanos- close timeoutoccurred- exception
-
logCreateSqlStatement
protected void logCreateSqlStatement(TsurugiSql ps)
called when create SQL definition.- Parameters:
ps- SQL definition
-
logSessionShutdown
protected void logSessionShutdown(TsurugiSession session, TgSessionShutdownType shutdownType, @Nullable java.lang.Throwable occurred)
called when shutdown session.- Parameters:
session- sessionshutdownType- shutdown typeoccurred- exception- Since:
- 1.4.0
-
logSessionClose
protected void logSessionClose(TsurugiSession session, @Nullable java.lang.Throwable occurred)
called when close session.- Parameters:
session- sessionoccurred- exception
-
doLogTmExecuteStart
protected void doLogTmExecuteStart(int iceaxeTmExecuteId)
do transactionManager execute start.- Parameters:
iceaxeTmExecuteId- iceaxe tm executeId
-
createTmLog
protected TgSessionTmLog createTmLog()
Creates a new transaction manager execute log.- Returns:
- transaction manager execute log
-
getTmLog
protected TgSessionTmLog getTmLog(int iceaxeTmExecuteId)
get transaction manager execute log.- Parameters:
iceaxeTmExecuteId- iceaxe tm executeId- Returns:
- transaction manager execute log
-
logTmExecuteStart
protected void logTmExecuteStart(TgSessionTmLog tmLog)
called when transactionManager execute start.- Parameters:
tmLog- transaction manager log
-
doLogTmExecuteException
protected void doLogTmExecuteException(TsurugiTransaction transaction, java.lang.Throwable occurred)
do transactionManager execute error.- Parameters:
transaction- transactionoccurred- exception
-
logTmExecuteException
protected void logTmExecuteException(TgSessionTxLog txLog, java.lang.Throwable occurred)
called when occurs transactionManager execute error.- Parameters:
txLog- transaction logoccurred- exception
-
doLogTmExecuteRetry
protected void doLogTmExecuteRetry(TsurugiTransaction transaction, java.lang.Exception cause, TgTmTxOption nextTmOption)
do transactionManager execute retry.- Parameters:
transaction- transactioncause- retry exceptionnextTmOption- next transaction option
-
logTmExecuteRetry
protected void logTmExecuteRetry(TgSessionTxLog txLog, java.lang.Exception cause, TgTmTxOption nextTmOption)
called when transactionManager execute retry.- Parameters:
txLog- transaction logcause- retry exceptionnextTmOption- next transaction option
-
doLogTmExecuteEnd
protected void doLogTmExecuteEnd(int iceaxeTmExecuteId, @Nullable TsurugiTransaction transaction, boolean committed, @Nullable java.lang.Object returnValue, @Nullable java.lang.Throwable occurred)do transactionManager execute end.- Parameters:
iceaxeTmExecuteId- iceaxe tm executeIdtransaction- transactioncommitted-trueif committedreturnValue- return valueoccurred- exception
-
logTmExecuteEnd
protected void logTmExecuteEnd(TgSessionTmLog tmLog, @Nullable java.lang.Throwable occurred)
called when transactionManager execute end.- Parameters:
tmLog- transaction manager logoccurred- exception
-
doLogTransactionStart
protected void doLogTransactionStart(TsurugiTransaction transaction, java.time.ZonedDateTime startTime)
do transaction start.- Parameters:
transaction- transactionstartTime- start time
-
createTxLog
protected TgSessionTxLog createTxLog()
Creates a new transaction log instance.- Returns:
- transaction log
-
getTxLog
protected TgSessionTxLog getTxLog(TsurugiTransaction transaction)
get transaction log.- Parameters:
transaction- transaction- Returns:
- transaction log
-
logTransactionStart
protected void logTransactionStart(TgSessionTxLog txLog)
called when transaction start.- Parameters:
txLog- transaction log
-
doLowTransactionGetStart
protected void doLowTransactionGetStart(TsurugiTransaction transaction)
do get transactionId.- Parameters:
transaction- transaction
-
logLowTransactionGetStart
protected void logLowTransactionGetStart(TgSessionTxLog txLog)
called when get transactionId.- Parameters:
txLog- transaction log
-
doLowTransactionGetEnd
protected void doLowTransactionGetEnd(TsurugiTransaction transaction, java.lang.String transactionId, java.lang.Throwable occurred)
do get transactionId.- Parameters:
transaction- transactiontransactionId- transaction idoccurred- exception
-
logLowTransactionGetEnd
protected void logLowTransactionGetEnd(TgSessionTxLog txLog, @Nullable java.lang.String transactionId, @Nullable java.lang.Throwable occurred)
called when get transactionId.- Parameters:
txLog- transaction logtransactionId- transactionIdoccurred- exception
-
doLogTransactionSqlStart
protected void doLogTransactionSqlStart(TsurugiTransaction transaction, TsurugiTransaction.TgTxMethod method, int iceaxeTxExecuteId, TsurugiSql ps, java.lang.Object parameter)
do execute SQL start.- Parameters:
transaction- transactionmethod- execute methodiceaxeTxExecuteId- iceaxe tm executeIdps- SQL definitionparameter- SQL parameter
-
logTransactionSqlStart
protected void logTransactionSqlStart(TsurugiTransaction.TgTxMethod method, TgSessionTxLog txLog, TgSessionTxLog.TgSessionTxExecuteLog exLog, TsurugiSql ps, java.lang.Object parameter)
called when execute SQL start.- Parameters:
method- execute methodtxLog- transaction logexLog- transaction SQL execute logps- SQL definitionparameter- SQL parameter
-
doLogTransactionSqlEnd
protected void doLogTransactionSqlEnd(TsurugiTransaction transaction, TsurugiTransaction.TgTxMethod method, int iceaxeTxExecuteId, TsurugiSql ps, java.lang.Object parameter, @Nullable TsurugiSqlResult result, @Nullable java.lang.Throwable occurred)
do execute SQL end.- Parameters:
transaction- transactionmethod- execute methodiceaxeTxExecuteId- iceaxe tm executeIdps- SQL definitionparameter- SQL parameterresult- SQL resultoccurred- exception
-
logTransactionSqlEnd
protected void logTransactionSqlEnd(TsurugiTransaction.TgTxMethod method, TgSessionTxLog txLog, TgSessionTxLog.TgSessionTxExecuteLog exLog, TsurugiSql ps, java.lang.Object parameter, @Nullable TsurugiSqlResult result, @Nullable java.lang.Throwable occurred)
called when execute SQL end.- Parameters:
method- execute methodtxLog- transaction logexLog- transaction SQL execute logps- SQL definitionparameter- SQL parameterresult- SQL resultoccurred- exception
-
doLogTransactionCommitStart
protected void doLogTransactionCommitStart(TsurugiTransaction transaction, TgCommitOption commitOption)
do commit start.- Parameters:
transaction- transactioncommitOption- commit option
-
logTransactionCommitStart
@Deprecated(since="1.10.0", forRemoval=true) protected void logTransactionCommitStart(TgSessionTxLog txLog, TgCommitType commitType)Deprecated, for removal: This API element is subject to removal in a future version.called when commit start.- Parameters:
txLog- transaction logcommitType- commit type- See Also:
logTransactionCommitStart(TgSessionTxLog, TgCommitOption)
-
logTransactionCommitStart
protected void logTransactionCommitStart(TgSessionTxLog txLog, TgCommitOption commitOption)
called when commit start.- Parameters:
txLog- transaction logcommitOption- commit option- Since:
- 1.10.0
-
doLogTransactionCommitEnd
protected void doLogTransactionCommitEnd(TsurugiTransaction transaction, TgCommitOption commitOption, @Nullable java.lang.Throwable occurred)
do commit end.- Parameters:
transaction- transactioncommitOption- commit optionoccurred- exception
-
logTransactionCommitEnd
@Deprecated(since="1.10.0", forRemoval=true) protected void logTransactionCommitEnd(TgSessionTxLog txLog, TgCommitType commitType, @Nullable java.lang.Throwable occurred)Deprecated, for removal: This API element is subject to removal in a future version.called when commit end.- Parameters:
txLog- transaction logcommitType- commit typeoccurred- exception- See Also:
logTransactionCommitEnd(TgSessionTxLog, TgCommitOption, Throwable)
-
logTransactionCommitEnd
protected void logTransactionCommitEnd(TgSessionTxLog txLog, TgCommitOption commitOption, @Nullable java.lang.Throwable occurred)
called when commit end.- Parameters:
txLog- transaction logcommitOption- commit optionoccurred- exception- Since:
- 1.10.0
-
doLogTransactionRollbackStart
protected void doLogTransactionRollbackStart(TsurugiTransaction transaction)
do rollback start.- Parameters:
transaction- transaction
-
logTransactionRollbackStart
protected void logTransactionRollbackStart(TgSessionTxLog txLog)
called when rollback start.- Parameters:
txLog- transaction log
-
doLogTransactionRollbackEnd
protected void doLogTransactionRollbackEnd(TsurugiTransaction transaction, @Nullable java.lang.Throwable occurred)
do rollback end.- Parameters:
transaction- transactionoccurred- exception
-
logTransactionRollbackEnd
protected void logTransactionRollbackEnd(TgSessionTxLog txLog, @Nullable java.lang.Throwable occurred)
called when rollback end.- Parameters:
txLog- transaction logoccurred- exception
-
doLogTransactionClose
protected void doLogTransactionClose(TsurugiTransaction transaction, @Nullable java.lang.Throwable occurred)
do transaction close.- Parameters:
transaction- transactionoccurred- exception
-
logTransactionClose
protected void logTransactionClose(TgSessionTxLog txLog, @Nullable java.lang.Throwable occurred)
called when transaction close.- Parameters:
txLog- transaction logoccurred- exception
-
doLogSqlStart
protected void doLogSqlStart(TsurugiTransaction transaction, int iceaxeSqlExecuteId, TsurugiSql ps, java.lang.Object parameter)
do SQL start.- Parameters:
transaction- transactioniceaxeSqlExecuteId- iceaxe SQL executeIdps- SQL definitionparameter- SQL parameter
-
logSqlStart
protected void logSqlStart(TgSessionTxLog txLog, TgSessionSqlLog sqlLog)
called when SQL execute start.- Parameters:
txLog- transaction logsqlLog- SQL log
-
doLogSqlStartException
protected void doLogSqlStartException(TsurugiTransaction transaction, int iceaxeSqlExecuteId, java.lang.Throwable occurred)
do SQL execute start error.- Parameters:
transaction- transactioniceaxeSqlExecuteId- iceaxe SQL executeIdoccurred- exception
-
logSqlStartException
protected void logSqlStartException(TgSessionTxLog txLog, TgSessionSqlLog sqlLog, java.lang.Throwable occurred)
called when occurs exception SQL execute start.- Parameters:
txLog- transaction logsqlLog- SQL logoccurred- exception
-
doLogSqlStarted
protected void doLogSqlStarted(TsurugiTransaction transaction, TsurugiSqlResult result)
do SQL execute started.- Parameters:
transaction- transactionresult- SQL result
-
logSqlStarted
protected void logSqlStarted(TgSessionTxLog txLog, TgSessionSqlLog sqlLog)
called when SQL execute started.- Parameters:
txLog- transaction logsqlLog- SQL log
-
doLogSqlRead
protected <R> void doLogSqlRead(TsurugiTransaction transaction, TsurugiQueryResult<R> result, R record)
do SQL read.- Type Parameters:
R- record type- Parameters:
transaction- transactionresult- SQL resultrecord- record
-
logSqlRead
protected <R> void logSqlRead(TgSessionTxLog txLog, TgSessionSqlLog sqlLog, TsurugiQueryResult<R> result, R record)
called when SQL read.- Type Parameters:
R- result type- Parameters:
txLog- transaction logsqlLog- SQL logresult- SQL resultrecord- record
-
doLogSqlReadException
protected <R> void doLogSqlReadException(TsurugiTransaction transaction, TsurugiQueryResult<R> result, java.lang.Throwable occurred)
do SQL read error.- Type Parameters:
R- record type- Parameters:
transaction- transactionresult- SQL resultoccurred- exception
-
logSqlReadException
protected <R> void logSqlReadException(TgSessionTxLog txLog, TgSessionSqlLog sqlLog, TsurugiQueryResult<R> result, java.lang.Throwable occurred)
called when occurs exception SQL read.- Type Parameters:
R- record type- Parameters:
txLog- transaction logsqlLog- SQL logresult- SQL resultoccurred- exception
-
doLogSqlEnd
protected void doLogSqlEnd(TsurugiTransaction transaction, TsurugiSqlResult result, @Nullable java.lang.Throwable occurred)
do SQL execute end.- Parameters:
transaction- transactionresult- SQL resultoccurred- exception
-
logSqlEnd
protected void logSqlEnd(TgSessionTxLog txLog, TgSessionSqlLog sqlLog, @Nullable java.lang.Throwable occurred)
called when SQL execute end.- Parameters:
txLog- transaction logsqlLog- SQL logoccurred- exception
-
doLogSqlClose
protected void doLogSqlClose(TsurugiTransaction transaction, TsurugiSqlResult result, @Nullable java.lang.Throwable occurred)
do SQL result close.- Parameters:
transaction- transactionresult- SQL resultoccurred- exception
-
logSqlClose
protected void logSqlClose(TgSessionTxLog txLog, TgSessionSqlLog sqlLog, @Nullable java.lang.Throwable occurred)
called when SQL result close.- Parameters:
txLog- transaction logsqlLog- SQL logoccurred- exception
-
-