commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From di...@apache.org
Subject cvs commit: jakarta-commons/dbcp/src/test/org/apache/commons/dbcp TesterConnection.java
Date Thu, 20 May 2004 13:07:43 GMT
dirkv       2004/05/20 06:07:43

  Modified:    dbcp/src/test/org/apache/commons/dbcp TesterConnection.java
  Log:
  Throw an exception when trying to commit/rollback a readonly connection
  
  Revision  Changes    Path
  1.14      +7 -1      jakarta-commons/dbcp/src/test/org/apache/commons/dbcp/TesterConnection.java
  
  Index: TesterConnection.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/dbcp/src/test/org/apache/commons/dbcp/TesterConnection.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- TesterConnection.java	1 May 2004 12:52:23 -0000	1.13
  +++ TesterConnection.java	20 May 2004 13:07:43 -0000	1.14
  @@ -70,6 +70,9 @@
   
       public void commit() throws SQLException {
           checkOpen();
  +        if (isReadOnly()) {
  +            throw new SQLException("Cannot commit a readonly connection");
  +        }
       }
   
       public Statement createStatement() throws SQLException {
  @@ -159,6 +162,9 @@
   
       public void rollback() throws SQLException {
           checkOpen();
  +        if (isReadOnly()) {
  +            throw new SQLException("Cannot rollback a readonly connection");
  +        }
       }
   
       public void setAutoCommit(boolean autoCommit) throws SQLException {
  
  
  

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


Mime
View raw message