db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/broker/accesslayer JdbcAccessImpl.java
Date Fri, 30 May 2003 16:23:25 GMT
brj         2003/05/30 09:23:25

  Modified:    src/java/org/apache/ojb/broker/accesslayer
                        JdbcAccessImpl.java
  Log:
  add logging after stmt is bound
  
  Revision  Changes    Path
  1.10      +20 -4     db-ojb/src/java/org/apache/ojb/broker/accesslayer/JdbcAccessImpl.java
  
  Index: JdbcAccessImpl.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/accesslayer/JdbcAccessImpl.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- JdbcAccessImpl.java	21 Apr 2003 07:55:57 -0000	1.9
  +++ JdbcAccessImpl.java	30 May 2003 16:23:24 -0000	1.10
  @@ -109,7 +109,7 @@
        */
       public void executeDelete(ClassDescriptor cld, Object obj) throws PersistenceBrokerException
       {
  -        logger.safeDebug("executeDelete",obj);
  +        logger.safeDebug("executeDelete",obj);     
   
           PreparedStatement stmt = null;
           try
  @@ -120,7 +120,10 @@
               	logger.error("getDeleteStatement returned a null statement");
               	throw new PersistenceBrokerException("getDeleteStatement returned a null statement");
               }
  -            broker.serviceStatementManager().bindDelete(stmt, cld, obj);
  +
  +            broker.serviceStatementManager().bindDelete(stmt, cld, obj);           
  +            if (logger.isDebugEnabled()) logger.debug("executeDelete: " + stmt);
  +            
               if (stmt.executeUpdate() == 0 && cld.isLocking()) //BRJ
               {
                   throw new OptimisticLockException("Object has been modified by someone
else", obj);
  @@ -163,7 +166,10 @@
   		{
   			String sql = this.broker.serviceSqlGenerator().getPreparedDeleteStatement(query, cld);
   			stmt = broker.serviceStatementManager().getPreparedStatement(cld, sql, false);
  +
   			broker.serviceStatementManager().bindStatement(stmt, query, cld, 1);
  +            if (logger.isDebugEnabled()) logger.debug("executeDelete (by Query): " + stmt);
  +
   			stmt.executeUpdate();
   		}
   		catch (SQLException e)
  @@ -195,7 +201,10 @@
               	logger.error("getInsertStatement returned a null statement");
               	throw new PersistenceBrokerException("getInsertStatement returned a null statement");
               }
  +            
               broker.serviceStatementManager().bindInsert(stmt, cld, obj);
  +            if (logger.isDebugEnabled()) logger.debug("executeInsert: " + stmt);
  +
               stmt.executeUpdate();
           }
           catch (PersistenceBrokerException e)
  @@ -231,7 +240,7 @@
        */
       public ResultSetAndStatement executeQuery(Query query, ClassDescriptor cld) throws
PersistenceBrokerException
       {
  -        if(logger.isDebugEnabled()) logger.safeDebug("executeQuery", query);
  +        logger.safeDebug("executeQuery", query);
   
           ResultSetAndStatement retval = new ResultSetAndStatement(broker.serviceConnectionManager().getSupportedPlatform());
   		/**
  @@ -255,7 +264,10 @@
               {
                   String sql = this.broker.serviceSqlGenerator().getPreparedSelectStatement(query,
cld);
                   PreparedStatement stmt = broker.serviceStatementManager().getPreparedStatement(cld,
sql, scrollable);
  +
                   broker.serviceStatementManager().bindStatement(stmt, query, cld, 1);
  +                if (logger.isDebugEnabled()) logger.debug("executeQuery: " + stmt);
  +                
                   ResultSet rs = stmt.executeQuery();
                   // as we return the resultset for further operations, we cannot release
the statement yet.
                   // that has to be done by the JdbcAccess-clients (i.e. RsIterator, ProxyRsIterator
and PkEnumeration.)
  @@ -377,6 +389,7 @@
           throws PersistenceBrokerException
       {
           if (logger.isDebugEnabled()) logger.debug("executeUpdateSQL: " + sqlStatement);
  +
           int result;
           int index;
           PreparedStatement stmt = null;
  @@ -436,7 +449,10 @@
               	logger.error("getUpdateStatement returned a null statement");
               	throw new PersistenceBrokerException("getUpdateStatement returned a null statement");
               }
  +            
               broker.serviceStatementManager().bindUpdate(stmt, cld, obj);
  +            if (logger.isDebugEnabled()) logger.debug("executeUpdate: " + stmt);
  +            
               if (stmt.executeUpdate() == 0 && cld.isLocking()) //BRJ
               {
                   throw new OptimisticLockException("Object has been modified by someone
else", obj);
  
  
  

Mime
View raw message