try {
KiWiReasoningConnection connection = persistence.getConnection();
try {
// should not throw an exception and the program should have a database ID afterwards
connection.storeProgram(program);
connection.commit();
} finally {
connection.close();
}
} catch (SQLException ex) {
throw new SailException("cannot store program in database",ex);