Package org.xmlBlaster.contrib.db

Examples of org.xmlBlaster.contrib.db.I_DbPool.reserve()


            Connection conn1 = null;
            Connection conn2 = null;
            Statement st1 = null;
            Statement st2 = null;
            try {
               conn1 = pool.reserve();
               conn2 = pool.reserve();
               //conn1.setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
               //conn2.setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
               this.interceptor.clear();
               conn1.clearWarnings();
View Full Code Here


            Connection conn2 = null;
            Statement st1 = null;
            Statement st2 = null;
            try {
               conn1 = pool.reserve();
               conn2 = pool.reserve();
               //conn1.setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
               //conn2.setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
               this.interceptor.clear();
               conn1.clearWarnings();
               conn2.clearWarnings();
View Full Code Here

               conn1.setAutoCommit(false);
               st1.close();

               // Should be 2 since conn1 commits last
               this.interceptor.waitOnUpdate(this.sleepDelay, 2);
               conn = pool.reserve();
               Statement st = conn.createStatement();
               ResultSet rs = null;
               try {
                  rs = st.executeQuery("SELECT * from " + this.tableName2);
               }
View Full Code Here

            try {
               this.interceptor.clear();
               sql = "UPDATE " + this.tableName + " SET age=33 WHERE name='first'";
               pool.update(sql);
               this.interceptor.waitOnUpdate(this.sleepDelay, 1);
               conn = pool.reserve();
               Statement st = conn.createStatement();
               ResultSet rs = null;
               try {
                  rs = st.executeQuery("SELECT * from " + this.tableName2);
               }
View Full Code Here

            try {
               this.interceptor.clear();
               sql = "DELETE FROM " + this.tableName;
               pool.update(sql);
               this.interceptor.waitOnUpdate(this.sleepDelay, 1);
               conn = pool.reserve();
               Statement st = conn.createStatement();
               ResultSet rs = null;
               try {
                  rs = st.executeQuery("SELECT * from " + this.tableName2);
               }
View Full Code Here

            try {
               this.interceptor.clear();
               sql = "ALTER TABLE " + this.tableName + " ADD (city VARCHAR(30))";
               pool.update(sql);
               this.interceptor.waitOnUpdate(this.sleepDelay, 1);
               conn = pool.reserve();
               Statement st = conn.createStatement();
               ResultSet rs = null;
               try {
                  rs = st.executeQuery("SELECT * from " + this.tableName2);
               }
View Full Code Here

            try {
               this.interceptor.clear();
               sql = "DROP TABLE " + this.tableName;
               pool.update(sql);
               this.interceptor.waitOnUpdate(this.sleepDelay, 1);
               conn = pool.reserve();
               Statement st = conn.createStatement();
               ResultSet rs = null;
               try {
                  rs = st.executeQuery("SELECT * from " + this.tableName2);
                  assertTrue("Testing '" + sql + "'. It must have resulted in an exception but did not.", false);
View Full Code Here

      String name = readerInfo.get("replication.prefix", "repl_") + ".oldReplKey";
      persistentInfo.put(name, "0");

      Connection conn = null;
      try {
         conn = pool.reserve();
         boolean doWarn = false; // we don't want warnings on SQL Exceptions here.
         log.info("setUp: going to cleanup now ...");
         this.sleepDelay = this.readerInfo.getLong("test.sleepDelay", -1L);
         if (this.sleepDelay < 0L)
            this.sleepDelay = this.writerInfo.getLong("test.sleepDelay", 1500L);
View Full Code Here

      log.info("Start testPerformAllOperationsOnTable");
      I_DbPool pool = (I_DbPool)this.readerInfo.getObject("db.pool");
      assertNotNull("pool must be instantiated", pool);
      Connection conn = null;
      try {
         conn  = pool.reserve();
         conn.setAutoCommit(true);
         String sql = null;
         try {
            boolean force = false;
            String destination = null;
View Full Code Here

         {
            try {
               sql = "CREATE TABLE " + this.tableName + " (name VARCHAR(20), age INTEGER, PRIMARY KEY(name))";
               pool.update(sql);
               Thread.sleep(this.sleepDelay);
               conn = pool.reserve();
               Statement st = conn.createStatement();
               ResultSet rs = null;
               try {
                  rs = st.executeQuery("SELECT * from " + this.tableName2);
               }
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.