log.debug("Disabling triggers");
Check.isNull(sessionStatus.get(), "There is already a ADSessionStatus present in this thread, "
+ "call enable before calling disable again");
final boolean prevMode = OBContext.getOBContext().setInAdministratorMode(true);
try {
final SessionStatus localSessionStatus = OBProvider.getInstance().get(SessionStatus.class);
localSessionStatus.setImporting(true);
localSessionStatus.setClient(OBDal.getInstance().get(Client.class, "0"));
localSessionStatus.setOrganization(OBDal.getInstance().get(Organization.class, "0"));
OBDal.getInstance().save(localSessionStatus);
OBDal.getInstance().flush();
Check.isNotNull(localSessionStatus.getId(), "The id is not set after insert");
sessionStatus.set(localSessionStatus);
} finally {
OBContext.getOBContext().setInAdministratorMode(prevMode);
}
}