// flush and close session
ORMSession session = ORMUtil.getSession(pc,false);
if(session!=null) {// MUST do the same with all sesson using the same engine
ORMConfiguration config = session.getEngine().getConfiguration(pc);
if(config.autoManageSession()) {
session.flush(pc);
session.close(pc);
}
}
pc.getApplicationContext().reinitORM(pc);