Connection conn = Transaction.begin(ProjectPeer.DATABASE_NAME);
boolean success = false;
try {
entry.save(conn);
entry.setProjectCode(getRowCode("PJ", entry.getProjectId()));
entry.save(conn);
Transaction.commit(conn);
success = true;
} finally {
if (!success) Transaction.safeRollback(conn);