Examples of returnManagedConnection()


Examples of org.jboss.resource.connectionmanager.BaseConnectionManager2.returnManagedConnection()

      {
         Collection mcs = new ArrayList(pp.maxSize);
         for (int i = 0 ; i < pp.maxSize; i++)
            mcs.add(cm.getManagedConnection(subject, cri));
         for (Iterator i =  mcs.iterator(); i.hasNext(); )
            cm.returnManagedConnection((ConnectionListener)i.next(), false);

         assertTrue("Wrong number of connections counted: " + cm.getConnectionCount(), cm.getConnectionCount() == pp.maxSize);
         Thread.sleep(1500);
         ConnectionListener cl = cm.getManagedConnection(subject, cri);
         cm.returnManagedConnection(cl, false);
View Full Code Here

Examples of org.jboss.resource.connectionmanager.BaseConnectionManager2.returnManagedConnection()

            cm.returnManagedConnection((ConnectionListener)i.next(), false);

         assertTrue("Wrong number of connections counted: " + cm.getConnectionCount(), cm.getConnectionCount() == pp.maxSize);
         Thread.sleep(1500);
         ConnectionListener cl = cm.getManagedConnection(subject, cri);
         cm.returnManagedConnection(cl, false);

         // Let the idle remover kick in
         Thread.sleep(1500);
         assertTrue("Wrong number of connections counted: " + cm.getConnectionCount(), cm.getConnectionCount() == 1);
View Full Code Here

Examples of org.jboss.resource.connectionmanager.BaseConnectionManager2.returnManagedConnection()

      pp.idleTimeout = 2000;
      BaseConnectionManager2 cm = getCM(pp);
      try
      {
         ConnectionListener cl = cm.getManagedConnection(subject, cri);
         cm.returnManagedConnection(cl, false);
         // Allow fill to min to work
         Thread.sleep(1000);
         assertTrue("Wrong number of connections counted: " + cm.getConnectionCount(), cm.getConnectionCount() == pp.minSize);
         // Allow the idle remover to work
         Thread.sleep(3000);
View Full Code Here

Examples of org.jboss.resource.connectionmanager.BaseConnectionManager2.returnManagedConnection()

      pp.idleTimeout = 2000;
      BaseConnectionManager2 cm = getCM(pp);
      try
      {
         ConnectionListener cl = cm.getManagedConnection(subject, cri);
         cm.returnManagedConnection(cl, false);
         // Allow fill to min to work
         Thread.sleep(1000);
         assertTrue("Wrong number of connections counted: " + cm.getConnectionCount(), cm.getConnectionCount() == pp.maxSize);
         // Allow the idle remover to work
         Thread.sleep(3000);
View Full Code Here

Examples of org.jboss.resource.connectionmanager.BaseConnectionManager2.returnManagedConnection()

         pool.flush();

         // Put the connections back (should destroy/close them with no errors)
         for (Iterator i = cs.iterator(); i.hasNext();)
         {
            cm.returnManagedConnection((ConnectionListener)i.next(), true);
         }

         // Checkout all the connections with the new maximum size
         cs = new ArrayList();
         for (int i = 0; i < pp.maxSize; i++)
View Full Code Here

Examples of org.jboss.resource.connectionmanager.BaseConnectionManager2.returnManagedConnection()

         {
         }

         // Put the connections back into the new pool
         for (Iterator i = cs.iterator(); i.hasNext();)
            cm.returnManagedConnection((ConnectionListener)i.next(), true);
         assertTrue("Wrong number of connections counted: " + cm.getConnectionCount(), cm.getConnectionCount() == 0);
      }
      finally
      {
         shutdown(cm);
View Full Code Here

Examples of org.jboss.resource.connectionmanager.BaseConnectionManager2.returnManagedConnection()

         {
         }

         for (Iterator i = cs.iterator(); i.hasNext();)
         {
            cm.returnManagedConnection((ConnectionListener)i.next(), true);
         }

         assertTrue("Wrong number of connections counted: " + cm.getConnectionCount(), cm.getConnectionCount() == 0);
      }
      finally
View Full Code Here

Examples of org.jboss.resource.connectionmanager.BaseConnectionManager2.returnManagedConnection()

                     cont.await();

                     for (Iterator i = cs.iterator(); i.hasNext();)
                     {
                        cm.returnManagedConnection((ConnectionListener)i.next(), true);
                     }

                     done.countDown();
                  }
                  catch (InterruptedException ie)
View Full Code Here

Examples of org.jboss.resource.connectionmanager.NoTxConnectionManager.returnManagedConnection()

     
      //Let prefiller run
      Thread.sleep(5000);
     
      ConnectionListener cl = noTxn.getManagedConnection(null, null);
      noTxn.returnManagedConnection(cl, false);
     
      assertTrue(mcp.getConnectionDestroyedCount() == 0);

     
   }
View Full Code Here

Examples of org.jboss.resource.connectionmanager.NoTxConnectionManager.returnManagedConnection()

     
      //Let prefiller run
      Thread.sleep(5000);
     
      ConnectionListener cl = noTxn.getManagedConnection(null, null);
      noTxn.returnManagedConnection(cl, false);
     
      assertTrue(mcp.getConnectionDestroyedCount() > 0);
     
   }
  
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.