You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by ar...@apache.org on 2004/06/09 11:27:37 UTC

cvs commit: db-ojb/src/java/org/apache/ojb/broker/util/sequence SequenceManagerNextValImpl.java

arminw      2004/06/09 02:27:37

  Modified:    src/java/org/apache/ojb/broker/util/sequence
                        SequenceManagerNextValImpl.java
  Log:
  to avoid side-effects, never delete existing DB sequence
  
  Revision  Changes    Path
  1.17      +25 -23    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.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- SequenceManagerNextValImpl.java	22 May 2004 10:03:02 -0000	1.16
  +++ SequenceManagerNextValImpl.java	9 Jun 2004 09:27:37 -0000	1.17
  @@ -176,37 +176,39 @@
       {
           Statement stmt = null;
           StatementManagerIF stmtMan = getBrokerForClass().serviceStatementManager();
  -        try
  -        {
  -            stmt = stmtMan.getGenericStatement(cld, Query.NOT_SCROLLABLE);
  -            stmt.execute(getPlatform().dropSequenceQuery(sequenceName));
  -        }
  -        catch (Exception ignore)
  -        {
  -            // ignore it
  -        }
  -        finally
  -        {
  -            try
  -            {
  -                stmtMan.closeResources(stmt, null);
  -            }
  -            catch (Exception ignore)
  -            {
  -                // ignore it
  -            }
  -        }
  +// arminw: never try to remove existing sequences, because this may lead in unexpected behaviour
  +// if the reason for the create call isn't a missing sequence (e.g. network problems)  
  +//        try
  +//        {
  +//            stmt = stmtMan.getGenericStatement(cld, Query.NOT_SCROLLABLE);
  +//            stmt.execute(getPlatform().dropSequenceQuery(sequenceName));
  +//        }
  +//        catch (Exception ignore)
  +//        {
  +//            // ignore it
  +//        }
  +//        finally
  +//        {
  +//            try
  +//            {
  +//                stmtMan.closeResources(stmt, null);
  +//            }
  +//            catch (Exception ignore)
  +//            {
  +//                // ignore it
  +//            }
  +//        }
   
           try
           {
  -            stmt = getBrokerForClass().serviceStatementManager().getGenericStatement(cld, Query.NOT_SCROLLABLE);
  +            stmt = stmtMan.getGenericStatement(cld, Query.NOT_SCROLLABLE);
               stmt.execute(getPlatform().createSequenceQuery(sequenceName));
           }
           finally
           {
               try
               {
  -                getBrokerForClass().serviceStatementManager().closeResources(stmt, null);
  +                stmtMan.closeResources(stmt, null);
               }
               catch (Exception ignore)
               {
  
  
  

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