db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/broker/accesslayer ConnectionManagerImpl.java
Date Tue, 20 Jan 2004 17:07:48 GMT
arminw      2004/01/20 09:07:48

  Modified:    src/java/org/apache/ojb/broker/accesslayer
                        ConnectionManagerImpl.java
  Log:
  - only request autoCommit state of connection when necessary
  - throw PersistenceBrokerException with underlying SQLException
  
  Revision  Changes    Path
  1.11      +10 -7     db-ojb/src/java/org/apache/ojb/broker/accesslayer/ConnectionManagerImpl.java
  
  Index: ConnectionManagerImpl.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/accesslayer/ConnectionManagerImpl.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- ConnectionManagerImpl.java	18 Jan 2004 16:47:35 -0000	1.10
  +++ ConnectionManagerImpl.java	20 Jan 2004 17:07:48 -0000	1.11
  @@ -143,13 +143,16 @@
           {
               con = this.connectionFactory.lookupConnection(jcd);
               if (con == null) throw new PersistenceBrokerException("Cannot get connection
for " + jcd);
  -            try
  +            if (jcd.getUseAutoCommit() == JdbcConnectionDescriptor.AUTO_COMMIT_SET_TRUE_AND_TEMPORARY_FALSE)
               {
  -                this.originalAutoCommitState = con.getAutoCommit();
  -            }
  -            catch (SQLException e)
  -            {
  -                throw new PersistenceBrokerException("Cannot request autoCommit state on
the connection");
  +                try
  +                {
  +                    this.originalAutoCommitState = con.getAutoCommit();
  +                }
  +                catch (SQLException e)
  +                {
  +                    throw new PersistenceBrokerException("Cannot request autoCommit state
on the connection", e);
  +                }
               }
               if (log.isDebugEnabled()) log.debug("Request new connection from ConnectionFactory:
" + con);
           }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message