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/util/sequence SequenceManagerNextValImpl.java
Date Wed, 17 Dec 2003 10:23:12 GMT
arminw      2003/12/17 02:23:12

  Modified:    src/java/org/apache/ojb/broker/util/sequence
                        SequenceManagerNextValImpl.java
  Log:
  fix bug in resource handling
  
  Revision  Changes    Path
  1.11      +5 -13     db-ojb/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerNextValImpl.java
  
  Index: SequenceManagerNextValImpl.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerNextValImpl.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- SequenceManagerNextValImpl.java	13 Aug 2003 18:16:10 -0000	1.10
  +++ SequenceManagerNextValImpl.java	17 Dec 2003 10:23:12 -0000	1.11
  @@ -196,27 +196,19 @@
       {
           ResultSet rs = null;
           Statement stmt = null;
  -
  +        long result = -1;
           try
           {
               stmt = getBrokerForClass().serviceStatementManager().getGenericStatement(cld,
Query.NOT_SCROLLABLE);
               rs = stmt.executeQuery(getPlatform().nextSequenceQuery(sequenceName));
               rs.next();
  -            return rs.getLong(1);
  +            result = rs.getLong(1);
           }
           finally
           {
  -            try
  -            {
  -                if (rs != null)
  -                    rs.close();
  -                if (stmt != null)
  -                    stmt.close();
  -            }
  -            catch (SQLException ignore)
  -            {
  -            }
  +            getBrokerForClass().serviceStatementManager().closeResources(stmt, rs);
           }
  +        return result;
       }
   
       protected void createSequence(ClassDescriptor cld, String sequenceName) throws Exception
  
  
  

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