Package org.jugile.util

Examples of org.jugile.util.DBConnection.rollback()


        // copy fields to copy
        o.copy(bi(),this);
      }
      c.commit();
    } catch (Exception e) {
      try { c.rollback(); fail(e); } catch (Exception e2) { fail(e2); }
    } finally {
      try { c.free(); } catch (Exception e2) { fail(e2); }
    }
  }
 
View Full Code Here


      c.commit();
      modified = false; // not modified anymore
      // _modified Time still remains
      incrVersion();
    } catch (Exception e) {
      try { c.rollback(); fail(e); } catch (Exception e2) { fail(e2); }
    } finally {
      try { c.free(); } catch (Exception e2) { fail(e2); }
    }   
  }
 
View Full Code Here

    try {
      c.update(sql);
      c.commit();
    } catch (Exception e) {
      log.error("dbread failed",e);
      try { c.rollback(); } catch (Exception e2) { fail(e2);}
    } finally {
      try { c.free(); } catch (Exception e) {}
    }   
  }
View Full Code Here

      c.param(nid+idIncrement);
      c.param(obj);
      c.execute();
      c.commit();
    } catch (Exception e) {
      try { c.rollback(); } catch (Exception e2) { } fail(e);
    } finally {
      try { c.free(); } catch (Exception e) { log.fatal("could not free connection",e); }     
    }
    return nid;
  }
View Full Code Here

      try {
        int res = cd().saveToDB(c); // whole core domain cd()
        c.commit();
        return res;
      } catch (Exception e) {
        try { c.rollback(); fail(e); } catch (Exception e2) { fail(e2); }
      } finally {
        try { c.free(); } catch (Exception e2) { fail(e2); }
      }
    } catch (Exception e) {
      log.fatal("could not write domain to db", e);
View Full Code Here

    try {
      //reset();
      count = cd().loadFromDB(c,classes());
    } catch (Exception e) {
      log.error("dbread failed",e);
      try { c.rollback(); } catch (Exception e2) { fail(e2);}
    } finally {
      try { c.free(); } catch (Exception e) {}
    }
    return count;   
  }
View Full Code Here

      int res = uow().writeToDB(c, classes());
      DBQueue.writeMessage(delta, node(), nodes(), c);
      c.commit();
      return res;
    } catch (Exception e) {
      try { c.rollback(); } catch (Exception e2) { fail(e2); }
      log.error("could not write db changes",e);
      fail(e);
    } finally {
      try { c.free(); } catch (Exception e2) { fail(e2); }
    }
View Full Code Here

      }
      log.info("retrying write now: " + node);
      writeMessage(msg,node,nodes);
    } catch (Exception e) {
      try {
        c.rollback();
      } catch (Exception e2) {
        fail(e2);
      }
      fail(e);
    } finally {
View Full Code Here

        o._setState(null,bo.bi(),row);
        res.add(o);
      }
    } catch (Exception e) {
      log.error("dbread failed",e);
      try { c.rollback(); } catch (Exception e2) { fail(e2);}
    } finally {
      try { c.free(); } catch (Exception e) {}
    }
    return res;
  }
View Full Code Here

        m.id = id;
        m.ts = ts;
        m.nodeid = nodeid;
        msgs.add(m);
      }
      c.rollback();
     
      // mark all status in progress     
      sql = "update dbmq_queue_t set status=? ";
      sql += "where nodeid=? AND status=? AND msg_id IN ("+qmarks(ids.size())+")";
      c.prepare(sql);
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.