diff --git a/btm/src/main/java/bitronix/tm/BitronixTransactionManager.java b/btm/src/main/java/bitronix/tm/BitronixTransactionManager.java index 24114e4d..f0707954 100644 --- a/btm/src/main/java/bitronix/tm/BitronixTransactionManager.java +++ b/btm/src/main/java/bitronix/tm/BitronixTransactionManager.java @@ -302,6 +302,17 @@ public void dumpTransactionContexts() { } // if } + /** + * Dump an overview of all running transactions as info logs. + */ + public void dumpTransactionContextsInfo() { + log.info("dumping " + inFlightTransactions.size() + " transaction context(s)"); + for (Map.Entry entry : inFlightTransactions.entrySet()) { + BitronixTransaction tx = entry.getValue(); + log.info(tx.toString()); + } + } + /** * Shut down the transaction manager and release all resources held by it. *

This call will also close the resources pools registered by the {@link bitronix.tm.resource.ResourceLoader} @@ -321,40 +332,40 @@ public synchronized void shutdown() { log.info("shutting down Bitronix Transaction Manager"); internalShutdown(); - if (log.isDebugEnabled()) log.debug("shutting down resource loader"); + log.info("shutting down resource loader"); TransactionManagerServices.getResourceLoader().shutdown(); - if (log.isDebugEnabled()) log.debug("shutting down executor"); + log.info("shutting down executor"); TransactionManagerServices.getExecutor().shutdown(); - if (log.isDebugEnabled()) log.debug("shutting down task scheduler"); + log.info("shutting down task scheduler"); TransactionManagerServices.getTaskScheduler().shutdown(); - if (log.isDebugEnabled()) log.debug("shutting down journal"); + log.info("shutting down journal"); TransactionManagerServices.getJournal().shutdown(); - if (log.isDebugEnabled()) log.debug("shutting down recoverer"); + log.info("shutting down recoverer"); TransactionManagerServices.getRecoverer().shutdown(); - if (log.isDebugEnabled()) log.debug("shutting down configuration"); + log.info("shutting down configuration"); TransactionManagerServices.getConfiguration().shutdown(); // clear references TransactionManagerServices.clear(); - if (log.isDebugEnabled()) log.debug("shutdown ran successfully"); + log.info("shutdown ran successfully"); } private void internalShutdown() { shuttingDown = true; - dumpTransactionContexts(); + dumpTransactionContextsInfo(); int seconds = TransactionManagerServices.getConfiguration().getGracefulShutdownInterval(); int txCount = 0; try { txCount = inFlightTransactions.size(); while (seconds > 0 && txCount > 0) { - if (log.isDebugEnabled()) log.debug("still " + txCount + " in-flight transactions, waiting... (" + seconds + " second(s) left)"); + log.info("still " + txCount + " in-flight transactions, waiting... (" + seconds + " second(s) left)"); try { Thread.sleep(1000); } catch (InterruptedException ex) { @@ -368,11 +379,11 @@ private void internalShutdown() { } if (txCount > 0) { - if (log.isDebugEnabled()) log.debug("still " + txCount + " in-flight transactions, shutting down anyway"); - dumpTransactionContexts(); + log.info("still " + txCount + " in-flight transactions, shutting down anyway"); + dumpTransactionContextsInfo(); } else { - if (log.isDebugEnabled()) log.debug("all transactions finished, resuming shutdown"); + log.info("all transactions finished, resuming shutdown"); } }