Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > CVS update: joist/java/org/joist/security PermissionSelection.java RolePermissionMaintenance.java UnsecureServlet.java

Project highlights: Architectural Overview

joist
Discussion topic

Back to topic list

CVS update: joist/java/org/joist/security PermissionSelection.java RolePermissionMaintenance.java UnsecureServlet.java

Author davidp
Full name David C. Pellegrini
Date 2001-01-23 17:33:19 PST
Message User: davidp
  Date: 01/01/23 17:33:19

  Modified: java/org/joist/database UserManager.java
                        UserRoleManager.java
               java/org/joist/security PermissionSelection.java
                        RolePermissionMaintenance.java UnsecureServlet.java
  Log:
  Plugged memory leaks regarding village DataSets.
  
  Revision Changes Path
  1.57 +5 -1 joist/java/org/joist​/database/UserManage​r.java
  
  Index: UserManager.java
  ====================​====================​====================​=======
  RCS file: /cvs/joist/java/org/​joist/database/UserM​anager.java,v
  retrieving revision 1.56
  retrieving revision 1.57
  diff -u -r1.56 -r1.57
  --- UserManager.java 2001/01/18 06:06:12 1.56
  +++ UserManager.java 2001/01/24 01:33:18 1.57
  @@ -62,7 +62,7 @@
     * @author David C. Pellegrini <A HREF="mailto:davidp@​dataweb-systems.com"​>davidp@dataweb-s​ystems.com</A>​
     * @author Leonard Richardson <A HREF="mailto:leonard​r@collab.net">leo​nardr at collab dot net<​/A>
     * @author <A HREF="mailto:dlr@col​lab.net">Daniel Rall</A>
  - * @version $Revision: 1.56 $
  + * @version $Revision: 1.57 $
     *
     * Copyright (c) 1999 dataweb systems, inc.
     * Copyright (c) 1999, 2000 CollabNet, Inc.
  @@ -182,6 +182,7 @@
           throws SQLException, DataSetException, JoistDatabaseException
       {
           TableDataSet user = new TableDataSet(conn, TABLE_NAME);
  + registerToClose(user);
           user.where
               (new StringBuffer(USER_ID​).append('=').append​(userID).toString())​;
           user.fetchRecords();
  @@ -213,6 +214,7 @@
           throws SQLException, DataSetException, JoistDatabaseException
       {
           TableDataSet user = new TableDataSet(conn, TABLE_NAME);
  + registerToClose(user);
           user.where(getSingle​Clause(NAME, name));
           user.fetchRecords();
           if (user != null && user.containsRecord(0))
  @@ -240,6 +242,7 @@
           throws SQLException, DataSetException, JoistDatabaseException
       {
           TableDataSet user = new TableDataSet(conn, TABLE_NAME);
  + registerToClose(user);
           user.where(getSingle​Clause(LOGIN_ID, loginID));
           user.fetchRecords();
           if (user != null && user.containsRecord(0))
  @@ -269,6 +272,7 @@
           throws SQLException, DataSetException, JoistDatabaseException
       {
           TableDataSet user = new TableDataSet(conn, TABLE_NAME);
  + registerToClose(user);
           user.where(getSingle​Clause(EMAIL, email));
           user.fetchRecords();
           if (user != null && user.containsRecord(0))
  
  
  
  1.10 +5 -1 joist/java/org/joist​/database/UserRoleMa​nager.java
  
  Index: UserRoleManager.java
  ====================​====================​====================​=======
  RCS file: /cvs/joist/java/org/​joist/database/UserR​oleManager.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- UserRoleManager.java 2000/07/05 21:29:27 1.9
  +++ UserRoleManager.java 2001/01/24 01:33:18 1.10
  @@ -63,7 +63,7 @@
     * updating, and deleting.
     *
     * @author David C. Pellegrini <A HREF="mailto:davidp@​dataweb-systems.com"​>davidp@dataweb-s​ystems.com</A>​
  - * @version $Revision: 1.9 $
  + * @version $Revision: 1.10 $
     *
     * Copyright (c) 1999 dataweb systems, inc.
     */
  @@ -798,6 +798,10 @@
           if (debug) log.debug(message);
           throw e;
           }
  + finally
  + {
  + registerToClose(qds);
  + }
   
           return qds;
       }
  
  
  
  1.7 +6 -2 joist/java/org/joist​/security/Permission​Selection.java
  
  Index: PermissionSelection.java
  ====================​====================​====================​=======
  RCS file: /cvs/joist/java/org/​joist/security/Permi​ssionSelection.java,​v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- PermissionSelection.java 2000/08/09 15:16:51 1.6
  +++ PermissionSelection.java 2001/01/24 01:33:19 1.7
  @@ -59,7 +59,7 @@
     * for additional processing, such as displaying details of the permission.
     *
     * @author David C. Pellegrini <A HREF="mailto:davidp@​dataweb-systems.com"​>davidp@dataweb-s​ystems.com</A>​
  - * @version $Revision: 1.6 $
  + * @version $Revision: 1.7 $
     *
     * Copyright (c) 1999 dataweb systems, inc.
    * Copyright (c) 1999, 2000 Collab.Net, Inc.
  @@ -84,7 +84,7 @@
       throws HandlerException, RedirectException
       {
       KeyDef kd;
  - TableDataSet tds;
  + TableDataSet tds = null;
       String ID = "permissionID";
       String phase = "Contemplating";
       String permissionID = getObjectID(context, ID);
  @@ -187,6 +187,10 @@
           String message = phase + " Permissions: " + e.getMessage();
           if (debug) log.debug(message);
           throw new HandlerException(message);
  + }
  + finally
  + {
  + getDataManager(conte​xt).registerToClose(​tds);
       }
   
       context.put("id", ID);
  
  
  
  1.7 +13 -8 joist/java/org/joist​/security/RolePermis​sionMaintenance.java​
  
  Index: RolePermissionMaintenance.java
  ====================​====================​====================​=======
  RCS file: /cvs/joist/java/org/​joist/security/RoleP​ermissionMaintenance​.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- RolePermissionMaintenance.java 2000/08/09 15:16:51 1.6
  +++ RolePermissionMaintenance.java 2001/01/24 01:33:19 1.7
  @@ -56,12 +56,14 @@
   
   import com.workingdogs.village.*;
   
  +import org.joist.database.DataManager;
  +
   /**
     * Display and process the list of permissions so that one may be selected
     * for additional processing, such as displaying details of the permission.
     *
     * @author David C. Pellegrini <A HREF="mailto:davidp@​dataweb-systems.com"​>davidp@dataweb-s​ystems.com</A>​
  - * @version $Revision: 1.6 $
  + * @version $Revision: 1.7 $
     *
     * Copyright (c) 1999 dataweb systems, inc.
    * Copyright (c) 1999, 2000 Collab.Net, Inc.
  @@ -86,9 +88,9 @@
       throws HandlerException, RedirectException
       {
       String ID = "permissionID";
  - QueryDataSet qds1;
  - QueryDataSet qds2;
  - QueryDataSet qds3;
  + QueryDataSet qds1 = null;
  + QueryDataSet qds2 = null;
  + QueryDataSet qds3 = null;
       String phase = "Contemplating";
   
       // Let the superclass do it's part.
  @@ -150,8 +152,6 @@
               throw new RedirectException("P​ermissionSelection")​;
           }
   
  - qds1.close();
  -
   
           // Get the roles
           phase = "Getting Roles";
  @@ -189,8 +189,6 @@
               checked.put(roleID, new Boolean(true));
           }
   
  - qds3.close();
  -
           context.put("checked", checked);
           context.put("id", ID);
           }
  @@ -210,6 +208,13 @@
           String message = phase + ": " + e.getMessage();
           if (debug) log.debug(message);
           throw new HandlerException(message);
  + }
  + finally
  + {
  + DataManager dMgr = getDataManager(context);
  + dMgr.registerToClose(qds1);
  + dMgr.registerToClose(qds2);
  + dMgr.registerToClose(qds3);
       }
   
       return templateName;
  
  
  
  1.104 +3 -1 joist/java/org/joist​/security/UnsecureSe​rvlet.java
  
  Index: UnsecureServlet.java
  ====================​====================​====================​=======
  RCS file: /cvs/joist/java/org/​joist/security/Unsec​ureServlet.java,v
  retrieving revision 1.103
  retrieving revision 1.104
  diff -u -r1.103 -r1.104
  --- UnsecureServlet.java 2001/01/23 07:42:18 1.103
  +++ UnsecureServlet.java 2001/01/24 01:33:19 1.104
  @@ -79,7 +79,7 @@
    *
    * @author David C. Pellegrini <A HREF="mailto:davidp@​dataweb-systems.com"​>davidp@dataweb-s​ystems.com</A>​
    * @author <a href="mailto:dlr@col​lab.net">Daniel Rall</a>
  - * @version $Revision: 1.103 $
  + * @version $Revision: 1.104 $
    *
    * Copyright (c) 1999 dataweb systems, inc.
    * Copyright (c) 1999, 2000 CollabNet, Inc.
  @@ -1075,6 +1075,8 @@
               session.putValue("Se​ssionManager", sMgr);
       }
   
  + //FIX: [davidp] is it really necessary or desireable to add sMgr to the
  + // context? We just want to get the instance of SessionManager, no more.
       context.put("SessionManager", sMgr);
       return sMgr;
       }

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

CVS update: joist/java/org/joist/security PermissionSelection.java RolePermissionMaintenance.java UnsecureServlet.java davidp David C. Pellegrini 2001-01-23 17:33:19 PST
Messages per page: