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/accesslayer RsIterator.java
Date Tue, 10 Feb 2004 15:18:53 GMT
arminw      2004/02/10 07:18:53

  Modified:    src/java/org/apache/ojb/broker/accesslayer RsIterator.java
  Log:
  fix, make sure that the reference object in weak map was not
  use when became 'null'
  
  Revision  Changes    Path
  1.58      +10 -7     db-ojb/src/java/org/apache/ojb/broker/accesslayer/RsIterator.java
  
  Index: RsIterator.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/accesslayer/RsIterator.java,v
  retrieving revision 1.57
  retrieving revision 1.58
  diff -u -r1.57 -r1.58
  --- RsIterator.java	6 Feb 2004 13:01:52 -0000	1.57
  +++ RsIterator.java	10 Feb 2004 15:18:53 -0000	1.58
  @@ -1015,27 +1015,30 @@
   
           public void beforeClose(PBStateEvent event)
           {
  -            if(ref != null && ref.get() != null)
  +            if(ref != null)
               {
  -                ((RsIterator)ref.get()).releaseDbResources();
  +                RsIterator rs = (RsIterator) ref.get();
  +                if(rs != null) rs.releaseDbResources();
                   ref = null;
               }
           }
   
           public void beforeRollback(PBStateEvent event)
           {
  -            if(ref != null && ref.get() != null)
  +            if(ref != null)
               {
  -                ((RsIterator)ref.get()).releaseDbResources();
  +                RsIterator rs = (RsIterator) ref.get();
  +                if(rs != null) rs.releaseDbResources();
                   ref = null;
               }
           }
   
           public void beforeCommit(PBStateEvent event)
           {
  -            if(ref != null && ref.get() != null)
  +            if(ref != null)
               {
  -                ((RsIterator)ref.get()).releaseDbResources();
  +                RsIterator rs = (RsIterator) ref.get();
  +                if(rs != null) rs.releaseDbResources();
                   ref = null;
               }
           }
  
  
  

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