Package java.sql

Examples of java.sql.Connection.commit()


         conn.commit();
         long t1 = System.currentTimeMillis();
         long dt = t1-t0;
         log.info("non-batch (single commit) statements='" + nmax + "' took '" + dt + "' ms (per statement: " + dt/nmax + ")");
         pool.update("delete from PERFORM");
         conn.commit();
      }
      {
         long t0 = System.currentTimeMillis();
         for (int i=0; i < nmax; i++) {
            ByteArrayInputStream bais = new ByteArrayInputStream(blob);
View Full Code Here


            PreparedStatement st = conn.prepareStatement(sql);
            st.setString(1, "name01_" + i);
            st.setString(2, "name02_" + i + "_hhjdhsdsdjsdkljsdjsdljljsdljsdkljsljsdsdsdsd");
            st.setBinaryStream(3, bais, blob.length);
            st.execute();
            conn.commit();
         }
         long t1 = System.currentTimeMillis();
         long dt = t1-t0;
         log.info("non-batch (all commit) statements='" + nmax + "' took '" + dt + "' ms (per statement: " + dt/nmax + ")");
         pool.update("delete from PERFORM");
View Full Code Here

         }
         long t1 = System.currentTimeMillis();
         long dt = t1-t0;
         log.info("non-batch (all commit) statements='" + nmax + "' took '" + dt + "' ms (per statement: " + dt/nmax + ")");
         pool.update("delete from PERFORM");
         conn.commit();
      }

      pool.update("DROP TABLE PERFORM");
      pool.release(conn);
      log.info("SUCCESS");
View Full Code Here

            }
            else {
               log.info("table to watch '" + table + "' not found");
            }
         }
         conn.commit(); // just to make oracle happy for the next set transaction
         conn.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);
         boolean autoCommit = false;
         conn.setAutoCommit(autoCommit);
         // retrieve the Sequence number here ...
         long newReplKey = incrementReplKey(conn);
View Full Code Here

               table = schema + "." + table;
            String sql = new String("SELECT * FROM " + table);
            I_ResultCb resultHandler = new RsToSqlInfo(this.initialUpdater, sqlInfo, this.cancelledUpdates, this.transformer, newReplKey, this.rowsPerMessage, destination);
            this.dbPool.select(conn, sql, autoCommit, resultHandler);
         }
         conn.commit();
      }
      catch (Exception ex) {
         removeFromPool(conn, ROLLBACK_YES);
         throw ex;
      }
View Full Code Here

            addSchemaToWatch(conn, catalog, schema);
         }
        
         TableToWatchInfo tableToWatch = getTableToWatch(conn, catalog, schema, tableName);
         if (!conn.getAutoCommit())
            conn.commit(); // to be sure it is a new transaction
         if (!force && tableToWatch != null && tableToWatch.isStatusOk(this, conn)) {
            // send it manually since table exits already and trigger is OK.
            log.info("table '" + tableName + "' is already registered, will add directly an entry in the ENTRIES Table");
            String destAttrName = "?";
            if (destinations == null || destinations.length == 0)
View Full Code Here

         else {
            filename = initialUpdater.buildFilename(replPrefix, requestedVersion);
         }
         long maxKey = this.incrementReplKey(conn);
         // if (!connInfo.isCommitted())
         conn.commit();
         List slavesList = new ArrayList();
         for (int i=0; i < slaveNames.length; i++) {
            if (!isCancelled(slaveNames[i]))
               slavesList.add(slaveNames[i]);
         }
View Full Code Here

            if (log.isLoggable(Level.FINE))
               log.fine("Request: '" + req + "'");
            update(req, conn);
         }
         if (!conn.getAutoCommit())
            conn.commit();
         return true;
      }
      catch (XmlBlasterException ex) {
         success = false;
         try {
View Full Code Here

            //preStatement.setBytes(7, blob);
            if (log.isLoggable(Level.FINE)) log.fine(preStatement.toString());
            preStatement.addBatch();
         }
         int[] ret = preStatement.executeBatch();
         if (!conn.getAutoCommit()) conn.commit();
         return ret;
       }
      catch (Throwable ex) {
         success = false;
         try {
View Full Code Here

               log.warning("Exception occurred when trying to drop the table '" + this.entriesTableName + "', it probably is already dropped. Reason: " + ex.toString());
            }
         }

         if (!conn.getAutoCommit())
            conn.commit();
      }
      catch (Throwable ex) {
         success = false;
         try {
            if (conn != null)
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.