Package org.infinispan.persistence.jdbc.connectionfactory

Examples of org.infinispan.persistence.jdbc.connectionfactory.PooledConnectionFactory


      }
   }

   public static void verifyConnectionLeaks(ConnectionFactory connectionFactory) {
      if (connectionFactory instanceof PooledConnectionFactory) {
         PooledConnectionFactory pcf = (PooledConnectionFactory) connectionFactory;
         try {
            Thread.sleep(500); // C3P0 needs a little delay before reporting the correct number of connections. Bah!
            assertEquals(pcf.getPooledDataSource().getNumBusyConnectionsAllUsers(), 0);
         } catch (Exception e) {
            throw new RuntimeException(e);
         }
      } else if (connectionFactory instanceof SimpleConnectionFactory) {
         SimpleConnectionFactory scf = (SimpleConnectionFactory) connectionFactory;
View Full Code Here


      static boolean started = false;

      @Override
      public void start(ConnectionFactoryConfiguration config, ClassLoader classLoader) throws PersistenceException {
         if (!started) {
            sharedFactory = new PooledConnectionFactory();
            sharedFactory.start(config, classLoader);
            started = true;
         }
      }
View Full Code Here

      TableManipulation tableManipulation = new TableManipulation(storeBuilder.table().create());
      // database type must now be determined
      tableManipulation.databaseType = null;
      tableManipulation.setCacheName("GuessDatabaseType");

      PooledConnectionFactory factory = new PooledConnectionFactory();
      ConnectionFactoryConfiguration config = UnitTestDatabaseManager
            .configureUniqueConnectionFactory(storeBuilder).create();
      factory.start(config, Thread.currentThread().getContextClassLoader());
      tableManipulation.start(factory);
      tableManipulation.getUpdateRowSql();
      UnitTestDatabaseManager.verifyConnectionLeaks(factory);
      tableManipulation.stop();
      factory.stop();
   }
View Full Code Here

      }
   }

   public static void verifyConnectionLeaks(ConnectionFactory connectionFactory) {
      if (connectionFactory instanceof PooledConnectionFactory) {
         PooledConnectionFactory pcf = (PooledConnectionFactory) connectionFactory;
         try {
            Thread.sleep(500); // C3P0 needs a little delay before reporting the correct number of connections. Bah!
            assertEquals(pcf.getPooledDataSource().getNumBusyConnectionsAllUsers(), 0);
         } catch (Exception e) {
            throw new RuntimeException(e);
         }
      } else if (connectionFactory instanceof SimpleConnectionFactory) {
         SimpleConnectionFactory scf = (SimpleConnectionFactory) connectionFactory;
View Full Code Here

      static boolean started = false;

      @Override
      public void start(ConnectionFactoryConfiguration config, ClassLoader classLoader) throws PersistenceException {
         if (!started) {
            sharedFactory = new PooledConnectionFactory();
            sharedFactory.start(config, classLoader);
            started = true;
         }
      }
View Full Code Here

            .addStore(JdbcStringBasedStoreConfigurationBuilder.class);

      factoryBuilder = storeBuilder
            .connectionFactory(UnitTestDatabaseManager.configureUniqueConnectionFactory(storeBuilder));

      factory = new PooledConnectionFactory();

      ConnectionFactoryConfiguration factoryConfiguration = factoryBuilder.create();
      factory.start(factoryConfiguration, Thread.currentThread().getContextClassLoader());

      int hadcodedMaxPoolSize = factory.getPooledDataSource().getMaxPoolSize();
View Full Code Here

            .persistence()
            .addStore(JdbcStringBasedStoreConfigurationBuilder.class);

      factoryBuilder = UnitTestDatabaseManager.configureBrokenConnectionFactory(storeBuilder);

      factory = new PooledConnectionFactory();

      ConnectionFactoryConfiguration factoryConfiguration = factoryBuilder.create();
      factory.start(factoryConfiguration, Thread.currentThread().getContextClassLoader());
   }
View Full Code Here

      }
   }

   public static void verifyConnectionLeaks(ConnectionFactory connectionFactory) {
      if (connectionFactory instanceof PooledConnectionFactory) {
         PooledConnectionFactory pcf = (PooledConnectionFactory) connectionFactory;
         try {
            Thread.sleep(500); // C3P0 needs a little delay before reporting the correct number of connections. Bah!
            assertEquals(pcf.getPooledDataSource().getNumBusyConnectionsAllUsers(), 0);
         } catch (Exception e) {
            throw new RuntimeException(e);
         }
      } else if (connectionFactory instanceof SimpleConnectionFactory) {
         SimpleConnectionFactory scf = (SimpleConnectionFactory) connectionFactory;
View Full Code Here

      //pass null dialect, it must now be determined automatically
      TableManipulation tableManipulation = new TableManipulation(storeBuilder.table().create(), null);
      tableManipulation.setCacheName("GuessDialect");

      PooledConnectionFactory factory = new PooledConnectionFactory();
      ConnectionFactoryConfiguration config = UnitTestDatabaseManager
            .configureUniqueConnectionFactory(storeBuilder).create();
      factory.start(config, Thread.currentThread().getContextClassLoader());
      tableManipulation.start(factory);
      tableManipulation.getUpdateRowSql();
      UnitTestDatabaseManager.verifyConnectionLeaks(factory);
      tableManipulation.stop();
      factory.stop();
   }
View Full Code Here

      static boolean started = false;

      @Override
      public void start(ConnectionFactoryConfiguration config, ClassLoader classLoader) throws PersistenceException {
         if (!started) {
            sharedFactory = new PooledConnectionFactory();
            sharedFactory.start(config, classLoader);
            started = true;
         }
      }
View Full Code Here

TOP

Related Classes of org.infinispan.persistence.jdbc.connectionfactory.PooledConnectionFactory

Copyright © 2018 www.massapicom. 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.