Package org.jugile.util

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


   
    // check db directly
    DBPool db = DBPool.getPool();
    DBConnection c = db.getConnection();
    List<List> rows = c.select("select name_f,id_f,vers from person_t where id_f="+p1.id());
    c.free();
    assertEquals(1,rows.size());
    List row = rows.get(0);
    assertEquals("foo",row.get(0));
    assertEquals(""+p1.id(),""+row.get(1));
    assertEquals("4",""+row.get(2));
View Full Code Here


      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.commit();
    } catch (Exception e) {
      try { c.rollback(); fail(e); } catch (Exception e2) { fail(e2); }
    } finally {
      try { c.free(); } catch (Exception e2) { fail(e2); }
    }
  }
 
  /**
   * Write to db immediately.
View Full Code Here

      // _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); }
    }   
  }
 
  protected void _setFlds(DomainData dd, BoInfo bi, List row, int idx) throws Exception {
    for (Field f : bi.flds) {
View Full Code Here

      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;
  }

  private static Boolean hasdb = null;
View Full Code Here

        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);
      fail(e);
    } finally {
View Full Code Here

      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;   
  }

  public int update() {
View Full Code Here

    } 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); }
    }
    return 0;
  }

View Full Code Here

      } catch (Exception e2) {
        fail(e2);
      }
      fail(e);
    } finally {
      try { c.free();
      } catch (Exception e3) {
        //fail(e3);
      }
    }
  }
View Full Code Here

      }
    } 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

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.