List<List> res = c.select();
nid = (Integer)res.get(0).get(0);
c.prepare("update idpool set nextid=? where obj=?");
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); }