Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl
In directory sc8-pr-cvs1:/tmp/cvs-serv7130/hibernate/impl
Modified Files:
BatcherImpl.java
Log Message:
added some logging
Index: BatcherImpl.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl/BatcherImpl.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** BatcherImpl.java 31 Oct 2002 16:58:13 -0000 1.1
--- BatcherImpl.java 25 Nov 2002 10:42:54 -0000 1.2
***************
*** 20,23 ****
--- 20,25 ----
public abstract class BatcherImpl implements Batcher {
+ public static int open;
+
protected static final Log log = LogFactory.getLog(BatcherImpl.class);
***************
*** 41,47 ****
--- 43,51 ----
public PreparedStatement prepareStatement(String sql) throws SQLException, HibernateException {
executeBatch();
+ logOpen();
return factory.getPreparedStatement( session.connection(), sql, false );
}
public PreparedStatement prepareQueryStatement(String sql, boolean scrollable) throws SQLException, HibernateException {
+ logOpen();
PreparedStatement ps = factory.getPreparedStatement( session.connection(), sql, scrollable );
factory.setFetchSize(ps);
***************
*** 52,59 ****
--- 56,65 ----
public void closeQueryStatement(PreparedStatement ps) throws SQLException {
statementsToClose.remove(ps);
+ logClose();
factory.closePreparedStatement(ps);
}
public void closeStatement(PreparedStatement ps) throws SQLException {
+ logClose();
factory.closePreparedStatement(ps);
}
***************
*** 97,100 ****
protected abstract void doExecuteBatch(PreparedStatement ps) throws SQLException, HibernateException;
!
}
--- 103,117 ----
protected abstract void doExecuteBatch(PreparedStatement ps) throws SQLException, HibernateException;
!
! private static void logOpen() {
! if ( log.isTraceEnabled() ) {
! open++;
! log.trace( open + " open PreparedStatements" );
! }
! }
!
! private static void logClose() {
! if ( log.isTraceEnabled() )
! open--;
! }
}
|