db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1484364 - /db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/Transaction.java
Date Sun, 19 May 2013 22:29:37 GMT
Author: tfischer
Date: Sun May 19 22:29:37 2013
New Revision: 1484364

URL: http://svn.apache.org/r1484364
Log:
TORQUE-287 add method Transaction.getTransactionManager()
use final modifier in method parameters

Modified:
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/Transaction.java

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/Transaction.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/Transaction.java?rev=1484364&r1=1484363&r2=1484364&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/Transaction.java
(original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/Transaction.java
Sun May 19 22:29:37 2013
@@ -35,7 +35,7 @@ import org.apache.torque.TorqueException
  */
 public final class Transaction
 {
-    /** The transaction manager to sue. */
+    /** The transaction manager to use. */
     private static TransactionManager transactionManager;
 
     /**
@@ -55,12 +55,22 @@ public final class Transaction
      * @param transactionManager the transaction manager to use.
      */
     public static void setTransactionManager(
-            TransactionManager transactionManager)
+            final TransactionManager transactionManager)
     {
         Transaction.transactionManager = transactionManager;
     }
 
     /**
+     * Returns the current transaction manager.
+     *
+     * @return the current transaction manager.
+     */
+    public static TransactionManager getTransactionManager()
+    {
+        return transactionManager;
+    }
+
+    /**
      * Begin a transaction by retrieving a connection from the default database
      * connection pool.
      * WARNING: If the database does not support transaction or the pool has set
@@ -89,7 +99,7 @@ public final class Transaction
      *
      * @throws TorqueException If the connection cannot be retrieved.
      */
-    public static Connection begin(String dbName) throws TorqueException
+    public static Connection begin(final String dbName) throws TorqueException
     {
         return transactionManager.begin(dbName);
     }
@@ -104,7 +114,7 @@ public final class Transaction
      * @throws TorqueException Any exceptions caught during processing will be
      *         rethrown wrapped into a TorqueException.
      */
-    public static void commit(Connection con) throws TorqueException
+    public static void commit(final Connection con) throws TorqueException
     {
         transactionManager.commit(con);
     }
@@ -119,7 +129,7 @@ public final class Transaction
      * @throws TorqueException Any exceptions caught during processing will be
      *         rethrown wrapped into a TorqueException.
      */
-    public static void rollback(Connection con) throws TorqueException
+    public static void rollback(final Connection con) throws TorqueException
     {
         transactionManager.rollback(con);
     }
@@ -132,7 +142,7 @@ public final class Transaction
      * @param con The Connection for the transaction.
      * @see Transaction#rollback(Connection)
      */
-    public static void safeRollback(Connection con)
+    public static void safeRollback(final Connection con)
     {
         transactionManager.safeRollback(con);
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message