db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From olegn...@apache.org
Subject cvs commit: jakarta-ojb/src/java/org/apache/ojb/broker/accesslayer ConnectionManager.java
Date Fri, 10 Jan 2003 00:45:52 GMT
olegnitz    2003/01/09 16:45:52

  Modified:    src/java/org/apache/ojb/broker/accesslayer
                        ConnectionManager.java
  Log:
  Fixed batch-mode="true", it didn't work originally
  
  Revision  Changes    Path
  1.24      +16 -4     jakarta-ojb/src/java/org/apache/ojb/broker/accesslayer/ConnectionManager.java
  
  Index: ConnectionManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ojb/src/java/org/apache/ojb/broker/accesslayer/ConnectionManager.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- ConnectionManager.java	9 Jan 2003 23:51:16 -0000	1.23
  +++ ConnectionManager.java	10 Jan 2003 00:45:52 -0000	1.24
  @@ -103,7 +103,7 @@
           this.jcd = MetadataManager.getInstance().connectionRepository().getDescriptor(pbKey);
           this.connectionFactory = ConnectionFactoryFactory.getInstance();
           this.platform = PlatformFactory.getPlatformFor(jcd);
  -	this.batchMode = this.jcd.getBatchMode();
  +        this.batchMode = this.jcd.getBatchMode();
       }
   
       /**
  @@ -196,8 +196,14 @@
           }
           try
           {
  -            if (con != null)
  +            if (batchCon != null)
  +            {
  +                batchCon.commit();
  +            }
  +            else if (con != null)
  +            {
                   con.commit();
  +            }
           }
           catch (SQLException e)
           {
  @@ -231,8 +237,14 @@
           {
               //truncate the local transaction
               this.isInLocalTransaction = false;
  -            if (con != null)
  +            if (batchCon != null)
  +            {
  +                batchCon.rollback();
  +            }
  +            else if (con != null)
  +            {
                   con.rollback();
  +            }
           }
           catch (SQLException e)
           {
  
  
  

Mime
View raw message