Commit bd3ec7c0 authored by Matt Tucker's avatar Matt Tucker Committed by matt

Added method to close a transaction with a pstmt argument.

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@3938 b35dd754-fafc-0310-a699-88a17e54d16e
parent 57d46c0d
......@@ -114,6 +114,24 @@ public class DbConnectionManager {
return con;
}
/**
* Closes a PreparedStatement and Connection. However, it first rolls back the transaction or
* commits it depending on the value of <code>abortTransaction</code>.
*/
public static void closeTransactionConnection(PreparedStatement pstmt, Connection con,
boolean abortTransaction)
{
try {
if (pstmt != null) {
pstmt.close();
}
}
catch (Exception e) {
Log.error(e);
}
closeTransactionConnection(con, abortTransaction);
}
/**
* Closes a Connection. However, it first rolls back the transaction or
* commits it depending on the value of <code>abortTransaction</code>.
......@@ -156,7 +174,8 @@ public class DbConnectionManager {
}
}
/** Closes a result set. This method should be called within the finally section of
/**
* Closes a result set. This method should be called within the finally section of
* your database logic, as in the following example:
*
* <pre>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment