Connection conn = Transaction.begin(DinboxEventPeer.DATABASE_NAME);
boolean success = false;
try {
entry.save(conn);
entry.setDinboxEventCode(getRowCode("IE", entry.getDinboxEventId()));
entry.save(conn);
Transaction.commit(conn);
success = true;
} finally {
if (!success) Transaction.safeRollback(conn);