tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r713924 - in /openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/transaction: JtaTransactionPolicy.java TxBeanManaged.java TxRequiresNew.java
Date Fri, 14 Nov 2008 06:23:51 GMT
Author: djencks
Date: Thu Nov 13 22:23:51 2008
New Revision: 713924

URL: http://svn.apache.org/viewvc?rev=713924&view=rev
Log:
OPENEJB-918 Fix string formatting to match openejb logging rather than slf4j logging.  Thanks
to Jarek Gawor for identifying the problem and the patch

Modified:
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/JtaTransactionPolicy.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TxBeanManaged.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TxRequiresNew.java

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/JtaTransactionPolicy.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/JtaTransactionPolicy.java?rev=713924&r1=713923&r2=713924&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/JtaTransactionPolicy.java
(original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/JtaTransactionPolicy.java
Thu Nov 13 22:23:51 2008
@@ -200,7 +200,7 @@
         try {
             return transactionManager.getTransaction();
         } catch (javax.transaction.SystemException e) {
-            txLogger.error("The Transaction Manager has encountered an unexpected error condition
while attempting to obtain current transaction: {}", e.getMessage());
+            txLogger.error("The Transaction Manager has encountered an unexpected error condition
while attempting to obtain current transaction: {0}", e.getMessage());
             throw new SystemException(e);
         }
     }
@@ -210,7 +210,7 @@
         try {
             if (tx != null && tx.getStatus() == Status.STATUS_ACTIVE) {
                 tx.setRollbackOnly();
-                txLogger.debug("TX {}: setRollbackOnly() on transaction {}", transactionType,
tx);
+                txLogger.debug("TX {0}: setRollbackOnly() on transaction {1}", transactionType,
tx);
             }
         } catch (Exception e) {
             txLogger.error("Exception during setRollbackOnly()", e);
@@ -224,7 +224,7 @@
             transactionManager.begin();
             transaction = transactionManager.getTransaction();
         } catch (Exception e) {
-            txLogger.error("The Transaction Manager has encountered an unexpected error condition
while attempting to begin a new transaction: {}", e.getMessage());
+            txLogger.error("The Transaction Manager has encountered an unexpected error condition
while attempting to begin a new transaction: {0}", e.getMessage());
             throw new SystemException(e);
         }
 
@@ -232,14 +232,14 @@
             throw new SystemException("Failed to begin a new transaction");
         }
 
-        txLogger.debug("TX {}: Started transaction {}", transactionType, transaction);
+        txLogger.debug("TX {0}: Started transaction {1}", transactionType, transaction);
         return transaction;
     }
 
     protected Transaction suspendTransaction() throws SystemException {
         try {
             Transaction tx = transactionManager.suspend();
-            txLogger.info("TX {}: Suspended transaction {}", transactionType, tx);
+            txLogger.info("TX {0}: Suspended transaction {1}", transactionType, tx);
             return tx;
         } catch (javax.transaction.SystemException se) {
             txLogger.error("Exception during suspend()", se);
@@ -250,22 +250,22 @@
     protected void resumeTransaction(Transaction tx) throws SystemException {
         try {
             if (tx == null) {
-                txLogger.debug("TX {}: No transaction to resume", transactionType);
+                txLogger.debug("TX {0}: No transaction to resume", transactionType);
             } else {
-                txLogger.debug("TX {}: Resuming transaction {}",transactionType, tx);
+                txLogger.debug("TX {0}: Resuming transaction {1}" ,transactionType, tx);
                 transactionManager.resume(tx);
             }
         } catch (InvalidTransactionException ite) {
 
-            txLogger.error("Could not resume the client's transaction, the transaction is
no longer valid: {}", ite.getMessage());
+            txLogger.error("Could not resume the client's transaction, the transaction is
no longer valid: {0}", ite.getMessage());
             throw new SystemException(ite);
         } catch (IllegalStateException e) {
 
-            txLogger.error("Could not resume the client's transaction: {}", e.getMessage());
+            txLogger.error("Could not resume the client's transaction: {0}", e.getMessage());
             throw new SystemException(e);
         } catch (javax.transaction.SystemException e) {
 
-            txLogger.error("Could not resume the client's transaction: The transaction reported
a system exception: {}", e.getMessage());
+            txLogger.error("Could not resume the client's transaction: The transaction reported
a system exception: {0}", e.getMessage());
             throw new SystemException(e);
         }
     }
@@ -275,7 +275,7 @@
         try {
             shouldRollback = tx.getStatus() != Status.STATUS_ACTIVE;
         } catch (javax.transaction.SystemException e) {
-            txLogger.error("The Transaction Manager has encountered an unexpected error condition
while attempting to obtain transaction status: {}", e.getMessage());
+            txLogger.error("The Transaction Manager has encountered an unexpected error condition
while attempting to obtain transaction status: {0}", e.getMessage());
             throw new SystemException(e);
         }
 
@@ -285,7 +285,7 @@
         }
 
         try {
-            txLogger.debug("TX {}: Committing transaction {}", transactionType, tx);
+            txLogger.debug("TX {0}: Committing transaction {1}", transactionType, tx);
             if (tx.equals(transactionManager.getTransaction())) {
 
                 transactionManager.commit();
@@ -294,32 +294,32 @@
             }
         } catch (RollbackException e) {
 
-            txLogger.debug("The transaction has been rolled back rather than commited: {}",
e.getMessage());
+            txLogger.debug("The transaction has been rolled back rather than commited: {0}",
e.getMessage());
             Throwable txe = new TransactionRolledbackException("Transaction was rolled back,
presumably because setRollbackOnly was called during a synchronization").initCause(e);
             throw new ApplicationException(txe);
 
         } catch (HeuristicMixedException e) {
 
-            txLogger.debug("A heuristic decision was made, some relevant updates have been
committed while others have been rolled back: {}", e.getMessage());
+            txLogger.debug("A heuristic decision was made, some relevant updates have been
committed while others have been rolled back: {0}", e.getMessage());
             throw new ApplicationException(new RemoteException("A heuristic decision was
made, some relevant updates have been committed while others have been rolled back").initCause(e));
 
         } catch (HeuristicRollbackException e) {
 
-            txLogger.debug("A heuristic decision was made while commiting the transaction,
some relevant updates have been rolled back: {}", e.getMessage());
+            txLogger.debug("A heuristic decision was made while commiting the transaction,
some relevant updates have been rolled back: {0}", e.getMessage());
             throw new ApplicationException(new RemoteException("A heuristic decision was
made while commiting the transaction, some relevant updates have been rolled back").initCause(e));
 
         } catch (SecurityException e) {
 
-            txLogger.error("The current thread is not allowed to commit the transaction:
{}", e.getMessage());
+            txLogger.error("The current thread is not allowed to commit the transaction:
{0}", e.getMessage());
             throw new SystemException(e);
 
         } catch (IllegalStateException e) {
 
-            txLogger.error("The current thread is not associated with a transaction: {}",
e.getMessage());
+            txLogger.error("The current thread is not associated with a transaction: {0}",
e.getMessage());
             throw new SystemException(e);
 
         } catch (javax.transaction.SystemException e) {
-            txLogger.error("The Transaction Manager has encountered an unexpected error condition
while attempting to commit the transaction: {}", e.getMessage());
+            txLogger.error("The Transaction Manager has encountered an unexpected error condition
while attempting to commit the transaction: {0}", e.getMessage());
 
             throw new SystemException(e);
         }
@@ -327,7 +327,7 @@
 
     protected void rollbackTransaction(Transaction tx) throws SystemException {
         try {
-            txLogger.debug("TX {}: Rolling back transaction {}", transactionType, tx);
+            txLogger.debug("TX {0}: Rolling back transaction {1}", transactionType, tx);
             if (tx.equals(transactionManager.getTransaction())) {
 
                 transactionManager.rollback();

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TxBeanManaged.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TxBeanManaged.java?rev=713924&r1=713923&r2=713924&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TxBeanManaged.java
(original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TxBeanManaged.java
Thu Nov 13 22:23:51 2008
@@ -57,7 +57,7 @@
             return null;
         }
 
-        txLogger.info("TX {}: Suspended transaction {}", transactionType, currentTx);
+        txLogger.info("TX {0}: Suspended transaction {1}", transactionType, currentTx);
 
         return new JtaSuspendedTransaction(currentTx);
     }
@@ -128,4 +128,4 @@
             }
         }
     }
-}
\ No newline at end of file
+}

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TxRequiresNew.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TxRequiresNew.java?rev=713924&r1=713923&r2=713924&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TxRequiresNew.java
(original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TxRequiresNew.java
Thu Nov 13 22:23:51 2008
@@ -70,7 +70,7 @@
             if (clientTx != null) {
                 resumeTransaction(clientTx);
             } else {
-                txLogger.debug("TX {}: No transaction to resume", transactionType);
+                txLogger.debug("TX {0}: No transaction to resume", transactionType);
             }
         }
     }



Mime
View raw message