Package java.sql

Examples of java.sql.Connection.commit()


                     log.severe("store: description with unknown action '" + action + "' invoked '" + description.toXml(""));
                  }
               }
               try {
                  if (!keepTransactionOpen) {
                     conn.commit();
                     log.fine("Transaction has been committed");
                  }
                  else
                     log.fine("The transaction will still be kept open");
                  needRollback = false;
View Full Code Here


         }
         if (count != uniqueIds.length)
            conn.rollback(); // not all entries have been deleted:
                             // will be handled individually below (to know which is deleted and which not)
         else {
            if (!conn.getAutoCommit()) conn.commit();
            boolean[] ret = new boolean[uniqueIds.length];
            for (int i=0; i < ret.length; i++) ret[i] = true;
            return ret;
         }
      }
View Full Code Here

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

         if (!conn.getAutoCommit())
            conn.commit();
      }
      catch (Throwable ex) {
         success = false;
         if (ex instanceof XmlBlasterException)
            throw (XmlBlasterException)ex;
View Full Code Here

            ret = refFactory.delete(store.getId(), refId, conn, timeout);
         if (meatId > -1L)
            ret1 = meatFactory.delete(store.getId(), meatId, conn, timeout);
         if (ret == 0)
            ret += ret1;
         conn.commit();
         return ret;
      }
      catch (Throwable ex) {
         rollback(conn);
         success = false;
View Full Code Here

                  meats[i].setId(refs[i].getMeatId());
               }
            }
         }
         long ret = deleteEntries(conn, store, refs, meats);
         conn.commit();
         return ret;
      }
      catch (Throwable ex) {
         rollback(conn);
         success = false;
View Full Code Here

         countRefs -= refFactory.count(store, conn, timeout);
         // add the store entry again since it could be used
         storeFactory.insert(store, conn, timeout);
         if (log.isLoggable(Level.FINE))
           log.fine("cleared " + countMeats + " meats and " + countRefs + " refs when clearing store " + store.getId() + " : " + store.toString());
         conn.commit();
         if (countRefs > 0L)
            return countRefs;
         return countMeats;
      }
      catch (Throwable ex) {
View Full Code Here

               st1.executeUpdate(sql);
               sql = "UPDATE " + this.tableName + " SET age=3 WHERE name='first'";
               st2.executeUpdate(sql);
               sql = "UPDATE " + this.tableName + " SET age=4 WHERE name='first'";
               st2.executeUpdate(sql);
               conn2.commit();
               conn2.setAutoCommit(false);
               st2.close();

               conn1.commit();
               conn1.setAutoCommit(false);
View Full Code Here

               st1.executeUpdate(sql);
               sql = "UPDATE " + this.tableName + " SET age=3 WHERE name='first'";
               st2.executeUpdate(sql);
               sql = "UPDATE " + this.tableName + " SET age=4 WHERE name='first'";
               st2.executeUpdate(sql);
               conn2.commit();
               conn2.setAutoCommit(false);
               st2.close();

               conn1.commit();
               conn1.setAutoCommit(false);
View Full Code Here

            if (oDiscardWrtr!=null) { oDiscardWrtr.close(); oDiscardWrtr=null; }

            oImplLoad.close();
            if (bRecoverable) {
            if (0==iErrorCount)
              oConn.commit();
            else
              oConn.rollback();
            }

            if (DebugFile.trace) DebugFile.writeln("Connection.close()");
View Full Code Here

        if (oDiscardWrtr!=null) { oDiscardWrtr.close(); oDiscardWrtr=null; }

        oImplLoad.close();
        if (bRecoverable) {
          if (0==iErrorCount)
            oConn.commit();
          else
            oConn.rollback();
        }

        if (DebugFile.trace) DebugFile.writeln("Connection.close()");
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.