[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jboss-cvs-commits
Subject:    [jboss-cvs] jbosscx/src/main/org/jboss/resource/connectionmanager CachedConnectionManager.java
From:       David Jencks <d_jencks () users ! sourceforge ! net>
Date:       2002-07-31 18:59:47
[Download RAW message or body]

  User: d_jencks
  Date: 02/07/31 11:59:47

  Modified:    src/main/org/jboss/resource/connectionmanager
                        CachedConnectionManager.java
  Log:
  Made connection caching work with reentrant ejbs
  
  Revision  Changes    Path
  1.7       +14 -18    \
jbosscx/src/main/org/jboss/resource/connectionmanager/CachedConnectionManager.java  
  Index: CachedConnectionManager.java
  ===================================================================
  RCS file: /cvsroot/jboss/jbosscx/src/main/org/jboss/resource/connectionmanager/CachedConnectionManager.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- CachedConnectionManager.java	29 Jun 2002 07:23:22 -0000	1.6
  +++ CachedConnectionManager.java	31 Jul 2002 18:59:47 -0000	1.7
  @@ -120,18 +120,16 @@
            {
               log.trace("old stack for key: " + key);
            } // end of if ()
  -         /* Remove attempt to recycle connections while we call another ejb.  \
                Users should
  -            close the handle if they need to reuse them. 
  -         if (!stack.isEmpty()) 
  -         {
  -            Object oldKey = stack.getLast();
  -            disconnect(oldKey, unsharableResources);
  -         } // end of if ()
  -         */
  +	 //At one time I attempted to recycle connections held over method calls.
  +	 //This caused problems if the other method call started a new transaction.
  +	 //To assure optimal use of connections, close them before calling out.
         } // end of else
  -      
  +      //check for reentrancy, reconnect if not reentrant.
  +      if (!stack.contains(key))
  +      {
  +	 reconnect(key, unsharableResources);
  +      }
         stack.addLast(key);
  -      reconnect(key, unsharableResources);
      }
   
      /**
  @@ -149,15 +147,13 @@
         {
            log.trace("popped object: " + oldKey);
         }
  -      disconnect(oldKey, unsharableResources);
  -      /*Remove attempt to recycle connections on a call to another ejb.
  -      if (!stack.isEmpty()) 
  +      if (!stack.contains(oldKey))
         {
  -         Object key = stack.getLast();
  -         reconnect(key, unsharableResources);
  -      } // end of if ()
  -      */
  -      //Should we remove it if empty??
  +	 disconnect(oldKey, unsharableResources);
  +      }
  +      //At one time I attempted to recycle connections held over method calls.
  +      //This caused problems if the other method call started a new transaction.
  +      //To assure optimal use of connections, close them before calling out.
      }
   
      Object peekMetaAwareObject()
  
  
  


-------------------------------------------------------
This sf.net email is sponsored by: Dice - The leading online job board
for high-tech professionals. Search and apply for tech jobs today!
http://seeker.dice.com/seeker.epl?rel_code=31
_______________________________________________
jboss-cvs-commits mailing list
jboss-cvs-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-cvs-commits


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic