Update of /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool
In directory sc8-pr-cvs1:/tmp/cvs-serv12856/src/java/org/logicalcobwebs/proxool
Modified Files:
AbstractProxyStatement.java
Log Message:
Optimisation to avoid preparing sql log if tracing is off.
Index: AbstractProxyStatement.java
===================================================================
RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/AbstractProxyStatement.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** AbstractProxyStatement.java 27 Oct 2003 11:18:42 -0000 1.15
--- AbstractProxyStatement.java 27 Oct 2003 12:21:59 -0000 1.16
***************
*** 170,181 ****
protected void trace(long startTime, Exception exception) throws SQLException {
! // Log if configured to
! if (connectionPool.getLog().isDebugEnabled() && connectionPool.getDefinition().isTrace()) {
! connectionPool.getLog().debug(sqlLog.toString() + " (" + (System.currentTimeMillis() - startTime) + " milliseconds" + (exception != null ? ", threw a " + exception.getClass().getName() + ": " + exception.getMessage() + ")" : ")"));
}
- // Send to any listener
- connectionPool.onExecute(sqlLog.toString(), (System.currentTimeMillis() - startTime), exception);
-
// Clear parameters for next time
if (parameters != null) {
--- 170,182 ----
protected void trace(long startTime, Exception exception) throws SQLException {
! if (isTrace()) {
! // Log if configured to
! if (connectionPool.getLog().isDebugEnabled() && connectionPool.getDefinition().isTrace()) {
! connectionPool.getLog().debug(sqlLog.toString() + " (" + (System.currentTimeMillis() - startTime) + " milliseconds" + (exception != null ? ", threw a " + exception.getClass().getName() + ": " + exception.getMessage() + ")" : ")"));
! }
! // Send to any listener
! connectionPool.onExecute(sqlLog.toString(), (System.currentTimeMillis() - startTime), exception);
}
// Clear parameters for next time
if (parameters != null) {
***************
*** 193,197 ****
*/
protected void appendToSqlLog() {
! if (sqlStatement != null && sqlStatement.length() > 0) {
int parameterIndex = 0;
StringTokenizer st = new StringTokenizer(sqlStatement, "?");
--- 194,198 ----
*/
protected void appendToSqlLog() {
! if (sqlStatement != null && sqlStatement.length() > 0 && isTrace()) {
int parameterIndex = 0;
StringTokenizer st = new StringTokenizer(sqlStatement, "?");
***************
*** 213,219 ****
}
sqlLog.append("; ");
! if (parameters != null) {
! parameters.clear();
! }
}
}
--- 214,220 ----
}
sqlLog.append("; ");
! }
! if (parameters != null) {
! parameters.clear();
}
}
***************
*** 239,242 ****
--- 240,246 ----
Revision history:
$Log$
+ Revision 1.16 2003/10/27 12:21:59 billhorsman
+ Optimisation to avoid preparing sql log if tracing is off.
+
Revision 1.15 2003/10/27 11:18:42 billhorsman
Fix for sqlStatement being null.
|