james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hb...@apache.org
Subject cvs commit: jakarta-james/src/org/apache/james/mailrepository AvalonMailRepository.java TownSpoolRepository.java
Date Fri, 30 Mar 2001 10:21:31 GMT
hbedi       01/03/30 02:21:31

  Modified:    src/org/apache/james/mailrepository
                        AvalonMailRepository.java TownSpoolRepository.java
  Log:
  <lock>-<unlock> is in try ... finally clause. This ensures that unlock is always
called.
  
  Revision  Changes    Path
  1.12      +7 -4      jakarta-james/src/org/apache/james/mailrepository/AvalonMailRepository.java
  
  Index: AvalonMailRepository.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/mailrepository/AvalonMailRepository.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- AvalonMailRepository.java	2001/03/13 22:08:57	1.11
  +++ AvalonMailRepository.java	2001/03/30 10:21:30	1.12
  @@ -146,10 +146,13 @@
       }
   
       public void remove(String key) {
  -        lock(key);
  -        sr.remove(key);
  -        or.remove(key);
  -        unlock(key);
  +        try {
  +            lock( key);
  +            sr.remove(key);
  +            or.remove(key);
  +        } finally {
  +            unlock(key);
  +        }
       }
   
       public Iterator list() {
  
  
  
  1.10      +3 -2      jakarta-james/src/org/apache/james/mailrepository/TownSpoolRepository.java
  
  Index: TownSpoolRepository.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/mailrepository/TownSpoolRepository.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- TownSpoolRepository.java	2001/03/05 15:17:48	1.9
  +++ TownSpoolRepository.java	2001/03/30 10:21:30	1.10
  @@ -234,8 +234,8 @@
   
       public void remove(String key) {
           //System.err.println("removing " + key);
  -        lock(key);
           try {
  +            lock(key);
               TableDataSet messages = new TableDataSet(ConnDefinition.getInstance(conndefinition),
tableName);
               messages.setWhere("message_name='" + key + "' and repository_name='" + repositoryName
+ "'");
               Record message = messages.getRecord(0);
  @@ -243,8 +243,9 @@
               message.save();
           } catch (Exception me) {
               throw new RuntimeException("Exception while removing mail: " + me.getMessage());
  +        } finally {
  +            unlock(key);
           }
  -        unlock(key);
       }
   
       public Iterator list() {
  
  
  

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


Mime
View raw message