agonism.dovetail.site
Class ConnectionHelper
java.lang.Object
|
+--agonism.dovetail.site.ConnectionHelper
- public class ConnectionHelper
- extends java.lang.Object
Keeps a reference-counted Connection object.
|
Field Summary |
static org.log4j.Category |
C
|
|
Constructor Summary |
ConnectionHelper()
Saves the current stack trace to an internal variable so that it can be printed to the WARN log
if the ConnectionHelper is not properly de-allocated. |
|
Method Summary |
protected void |
finalize()
If the java.sql.Connection held by the ConnectionHelper has not been properly freed, this
method prints diagnostic information to the WARN log, and frees the connection with the SQLDatabase. |
void |
freeConnection()
|
java.sql.Connection |
getConnection()
|
void |
setRequestURL(java.lang.String requestURL)
|
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
C
public static final org.log4j.Category C
ConnectionHelper
public ConnectionHelper()
- Saves the current stack trace to an internal variable so that it can be printed to the WARN log
if the ConnectionHelper is not properly de-allocated.
- See Also:
finalize()
setRequestURL
public void setRequestURL(java.lang.String requestURL)
getConnection
public java.sql.Connection getConnection()
freeConnection
public void freeConnection()
finalize
protected void finalize()
- If the java.sql.Connection held by the ConnectionHelper has not been properly freed, this
method prints diagnostic information to the WARN log, and frees the connection with the
SQLDatabase.
The diagnostic information includes the original request URL, if it is known, and a stack trace from
the ConnectionHelper constructor.
- Overrides:
finalize in class java.lang.Object