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/platforms PlatformInformixImpl.java
Date Thu, 10 Nov 2005 01:19:52 GMT
arminw      2005/11/09 17:19:52

  Modified:    src/java/org/apache/ojb/broker/platforms Tag:
                        OJB_1_0_RELEASE PlatformInformixImpl.java
  Log:
  ensure that the used statement will be closed after use
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.9.2.2   +17 -2     db-ojb/src/java/org/apache/ojb/broker/platforms/PlatformInformixImpl.java
  
  Index: PlatformInformixImpl.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/platforms/PlatformInformixImpl.java,v
  retrieving revision 1.9.2.1
  retrieving revision 1.9.2.2
  diff -u -r1.9.2.1 -r1.9.2.2
  --- PlatformInformixImpl.java	10 Nov 2005 01:03:51 -0000	1.9.2.1
  +++ PlatformInformixImpl.java	10 Nov 2005 01:19:51 -0000	1.9.2.2
  @@ -37,15 +37,30 @@
       public void initializeJdbcConnection(JdbcConnectionDescriptor jcd, Connection conn)
throws PlatformException
       {
           super.initializeJdbcConnection(jcd, conn);
  +        Statement stmt = null;
           try
           {
  -            Statement stmt = conn.createStatement();
  +            stmt = conn.createStatement();
               stmt.execute("SET LOCK MODE TO WAIT");
           }
  -        catch(SQLException e)
  +        catch (SQLException e)
           {
               // ignore it
           }
  +        finally
  +        {
  +            if(stmt != null)
  +            {
  +                try
  +                {
  +                    stmt.close();
  +                }
  +                catch(SQLException e)
  +                {
  +                    // ignore
  +                }
  +            }
  +        }
       }
   
       /**
  
  
  

---------------------------------------------------------------------
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