Class TsurugiSessionTxLogger

    • Constructor Detail

      • TsurugiSessionTxLogger

        public TsurugiSessionTxLogger()
    • Method Detail

      • 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 - session
        shutdownType - shutdown type
        occurred - exception
        Since:
        1.4.0
      • logSessionClose

        protected void logSessionClose​(TsurugiSession session,
                                       @Nullable
                                       java.lang.Throwable occurred)
        called when close session.
        Parameters:
        session - session
        occurred - 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 - transaction
        occurred - exception
      • logTmExecuteException

        protected void logTmExecuteException​(TgSessionTxLog txLog,
                                             java.lang.Throwable occurred)
        called when occurs transactionManager execute error.
        Parameters:
        txLog - transaction log
        occurred - exception
      • doLogTmExecuteRetry

        protected void doLogTmExecuteRetry​(TsurugiTransaction transaction,
                                           java.lang.Exception cause,
                                           TgTmTxOption nextTmOption)
        do transactionManager execute retry.
        Parameters:
        transaction - transaction
        cause - retry exception
        nextTmOption - next transaction option
      • logTmExecuteRetry

        protected void logTmExecuteRetry​(TgSessionTxLog txLog,
                                         java.lang.Exception cause,
                                         TgTmTxOption nextTmOption)
        called when transactionManager execute retry.
        Parameters:
        txLog - transaction log
        cause - retry exception
        nextTmOption - 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 executeId
        transaction - transaction
        committed - true if committed
        returnValue - return value
        occurred - exception
      • logTmExecuteEnd

        protected void logTmExecuteEnd​(TgSessionTmLog tmLog,
                                       @Nullable
                                       java.lang.Throwable occurred)
        called when transactionManager execute end.
        Parameters:
        tmLog - transaction manager log
        occurred - exception
      • doLogTransactionStart

        protected void doLogTransactionStart​(TsurugiTransaction transaction,
                                             java.time.ZonedDateTime startTime)
        do transaction start.
        Parameters:
        transaction - transaction
        startTime - 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 - transaction
        transactionId - transaction id
        occurred - exception
      • logLowTransactionGetEnd

        protected void logLowTransactionGetEnd​(TgSessionTxLog txLog,
                                               @Nullable
                                               java.lang.String transactionId,
                                               @Nullable
                                               java.lang.Throwable occurred)
        called when get transactionId.
        Parameters:
        txLog - transaction log
        transactionId - transactionId
        occurred - exception
      • doLogTransactionSqlStart

        protected void doLogTransactionSqlStart​(TsurugiTransaction transaction,
                                                TsurugiTransaction.TgTxMethod method,
                                                int iceaxeTxExecuteId,
                                                TsurugiSql ps,
                                                java.lang.Object parameter)
        do execute SQL start.
        Parameters:
        transaction - transaction
        method - execute method
        iceaxeTxExecuteId - iceaxe tm executeId
        ps - SQL definition
        parameter - 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 - transaction
        method - execute method
        iceaxeTxExecuteId - iceaxe tm executeId
        ps - SQL definition
        parameter - SQL parameter
        result - SQL result
        occurred - exception
      • doLogTransactionCommitStart

        protected void doLogTransactionCommitStart​(TsurugiTransaction transaction,
                                                   TgCommitType commitType)
        do commit start.
        Parameters:
        transaction - transaction
        commitType - commit type
      • logTransactionCommitStart

        protected void logTransactionCommitStart​(TgSessionTxLog txLog,
                                                 TgCommitType commitType)
        called when commit start.
        Parameters:
        txLog - transaction log
        commitType - commit type
      • doLogTransactionCommitEnd

        protected void doLogTransactionCommitEnd​(TsurugiTransaction transaction,
                                                 TgCommitType commitType,
                                                 @Nullable
                                                 java.lang.Throwable occurred)
        do commit end.
        Parameters:
        transaction - transaction
        commitType - commit type
        occurred - exception
      • logTransactionCommitEnd

        protected void logTransactionCommitEnd​(TgSessionTxLog txLog,
                                               TgCommitType commitType,
                                               @Nullable
                                               java.lang.Throwable occurred)
        called when commit end.
        Parameters:
        txLog - transaction log
        commitType - commit type
        occurred - exception
      • 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 - transaction
        occurred - exception
      • logTransactionRollbackEnd

        protected void logTransactionRollbackEnd​(TgSessionTxLog txLog,
                                                 @Nullable
                                                 java.lang.Throwable occurred)
        called when rollback end.
        Parameters:
        txLog - transaction log
        occurred - exception
      • doLogTransactionClose

        protected void doLogTransactionClose​(TsurugiTransaction transaction,
                                             @Nullable
                                             java.lang.Throwable occurred)
        do transaction close.
        Parameters:
        transaction - transaction
        occurred - exception
      • logTransactionClose

        protected void logTransactionClose​(TgSessionTxLog txLog,
                                           @Nullable
                                           java.lang.Throwable occurred)
        called when transaction close.
        Parameters:
        txLog - transaction log
        occurred - exception
      • doLogSqlStart

        protected void doLogSqlStart​(TsurugiTransaction transaction,
                                     int iceaxeSqlExecuteId,
                                     TsurugiSql ps,
                                     java.lang.Object parameter)
        do SQL start.
        Parameters:
        transaction - transaction
        iceaxeSqlExecuteId - iceaxe SQL executeId
        ps - SQL definition
        parameter - SQL parameter
      • logSqlStart

        protected void logSqlStart​(TgSessionTxLog txLog,
                                   TgSessionSqlLog sqlLog)
        called when SQL execute start.
        Parameters:
        txLog - transaction log
        sqlLog - SQL log
      • doLogSqlStartException

        protected void doLogSqlStartException​(TsurugiTransaction transaction,
                                              int iceaxeSqlExecuteId,
                                              java.lang.Throwable occurred)
        do SQL execute start error.
        Parameters:
        transaction - transaction
        iceaxeSqlExecuteId - iceaxe SQL executeId
        occurred - exception
      • logSqlStartException

        protected void logSqlStartException​(TgSessionTxLog txLog,
                                            TgSessionSqlLog sqlLog,
                                            java.lang.Throwable occurred)
        called when occurs exception SQL execute start.
        Parameters:
        txLog - transaction log
        sqlLog - SQL log
        occurred - exception
      • doLogSqlStarted

        protected void doLogSqlStarted​(TsurugiTransaction transaction,
                                       TsurugiSqlResult result)
        do SQL execute started.
        Parameters:
        transaction - transaction
        result - SQL result
      • logSqlStarted

        protected void logSqlStarted​(TgSessionTxLog txLog,
                                     TgSessionSqlLog sqlLog)
        called when SQL execute started.
        Parameters:
        txLog - transaction log
        sqlLog - SQL log
      • doLogSqlRead

        protected <R> void doLogSqlRead​(TsurugiTransaction transaction,
                                        TsurugiQueryResult<R> result,
                                        R record)
        do SQL read.
        Type Parameters:
        R - record type
        Parameters:
        transaction - transaction
        result - SQL result
        record - 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 log
        sqlLog - SQL log
        result - SQL result
        record - 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 - transaction
        result - SQL result
        occurred - 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 log
        sqlLog - SQL log
        result - SQL result
        occurred - exception
      • doLogSqlEnd

        protected void doLogSqlEnd​(TsurugiTransaction transaction,
                                   TsurugiSqlResult result,
                                   @Nullable
                                   java.lang.Throwable occurred)
        do SQL execute end.
        Parameters:
        transaction - transaction
        result - SQL result
        occurred - exception
      • logSqlEnd

        protected void logSqlEnd​(TgSessionTxLog txLog,
                                 TgSessionSqlLog sqlLog,
                                 @Nullable
                                 java.lang.Throwable occurred)
        called when SQL execute end.
        Parameters:
        txLog - transaction log
        sqlLog - SQL log
        occurred - exception
      • doLogSqlClose

        protected void doLogSqlClose​(TsurugiTransaction transaction,
                                     TsurugiSqlResult result,
                                     @Nullable
                                     java.lang.Throwable occurred)
        do SQL result close.
        Parameters:
        transaction - transaction
        result - SQL result
        occurred - exception
      • logSqlClose

        protected void logSqlClose​(TgSessionTxLog txLog,
                                   TgSessionSqlLog sqlLog,
                                   @Nullable
                                   java.lang.Throwable occurred)
        called when SQL result close.
        Parameters:
        txLog - transaction log
        sqlLog - SQL log
        occurred - exception