Examples of returnManagedConnection()


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

         ConnectionListener cl2 = cm.getManagedConnection(null, null);
         assertTrue("2: Got a null connection!", cl2.getManagedConnection() != null);
         assertTrue("2: Two connections", ps.getConnectionCount() == 2);

         // Return first
         cm.returnManagedConnection(cl, true);
         assertTrue("3: One connection", ps.getConnectionCount() == 1);

         // Return second
         cm.returnManagedConnection(cl2, true);
         assertTrue("4: Zero connections", ps.getConnectionCount() == 0);
View Full Code Here

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

         // Return first
         cm.returnManagedConnection(cl, true);
         assertTrue("3: One connection", ps.getConnectionCount() == 1);

         // Return second
         cm.returnManagedConnection(cl2, true);
         assertTrue("4: Zero connections", ps.getConnectionCount() == 0);
      }
      finally
      {
         shutdown(cm);
View Full Code Here

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

         // Get a connection
         ConnectionListener cl = cm.getManagedConnection(null, null);
         assertTrue("1: Got a null connection!", cl.getManagedConnection() != null);
         assertTrue("1: InternalManagedConnectionPool", cl.getContext() instanceof InternalManagedConnectionPool);
         InternalManagedConnectionPool imcp = (InternalManagedConnectionPool)cl.getContext();
         cm.returnManagedConnection(cl, true);

         // Shutdown the pool in order to trigger the RetryableResourceException
         imcp.shutdown();

         // Get a connection - new internal managed pool is created
View Full Code Here

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

         imcp.shutdown();

         // Get a connection - new internal managed pool is created
         cl = cm.getManagedConnection(null, null);
         assertTrue("2: Got a null connection!", cl.getManagedConnection() != null);
         cm.returnManagedConnection(cl, true);
      }
      finally
      {
         shutdown(cm);
      }
View Full Code Here

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

         ConnectionListener cl2 = cm.getManagedConnection(null, null);
         assertTrue("2: Got a null connection!", cl2.getManagedConnection() != null);
         assertTrue("2: Two connections", ps.getConnectionCount() == 2);

         // Return first
         cm.returnManagedConnection(cl, true);
         assertTrue("3: One connection", ps.getConnectionCount() == 1);

         // Return second
         cm.returnManagedConnection(cl2, true);
         assertTrue("4: Zero connections", ps.getConnectionCount() == 0);
View Full Code Here

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

         // Return first
         cm.returnManagedConnection(cl, true);
         assertTrue("3: One connection", ps.getConnectionCount() == 1);

         // Return second
         cm.returnManagedConnection(cl2, true);
         assertTrue("4: Zero connections", ps.getConnectionCount() == 0);
      }
      finally
      {
         shutdown(cm);
View Full Code Here

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

         assertTrue("2: Wrong number of connections counted: " + cm.getConnectionCount(), cm.getConnectionCount() == pp.maxSize);

         try
         {
            ConnectionListener cl = cm.getManagedConnection(null, null);
            cm.returnManagedConnection(cl, true);

            failedDescription = "Got a connection";
            failedException = new Exception(cl.toString());
            failed = true;
         }
View Full Code Here

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

                        long endGetConnection = System.currentTimeMillis();
                        //maybe should be synchronized
                        BaseConnectionManagerStressTestCase.this.connectionCount++;
                        Thread.sleep(sleepTime);
                        long startReturnConnection = System.currentTimeMillis();
                        cm.returnManagedConnection(cl, false);
                        long endReturnConnection = System.currentTimeMillis();
                       
                        duration += (endReturnConnection - startGetConnection);
                        getConnection += (endGetConnection - startGetConnection);
                        returnConnection += (endReturnConnection - startReturnConnection);
View Full Code Here

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

         {
            //expected
         } // end of try-catch
         for (Iterator i = cs.iterator(); i.hasNext();)
         {
            cm.returnManagedConnection((ConnectionListener)i.next(), true);
         } // end of for ()
         assertTrue("Wrong number of connections counted: " + cm.getConnectionCount(), cm.getConnectionCount() == 0);
      }
      finally
      {
View Full Code Here

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);
         // Let the idle remover kick in
         Thread.sleep(2500);
         assertTrue("Wrong number of connections counted: " + cm.getConnectionCount(), cm.getConnectionCount() == 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.