use of lucee.runtime.orm.ORMEngine in project Lucee by lucee.
the class PageContextImpl method releaseORM.
private void releaseORM() throws PageException {
try {
// flush orm session
ORMEngine engine = ormSession.getEngine();
ORMConfiguration config = engine.getConfiguration(this);
if (config == null || (config.flushAtRequestEnd() && config.autoManageSession())) {
ormSession.flushAll(this);
}
ormSession.closeAll(this);
manager.releaseORM();
} finally {
ormSession = null;
}
}
use of lucee.runtime.orm.ORMEngine in project Lucee by lucee.
the class ConfigImpl method getORMEngine.
@Override
public ORMEngine getORMEngine(PageContext pc) throws PageException {
String name = pc.getApplicationContext().getName();
ORMEngine engine = ormengines.get(name);
if (engine == null) {
// try {
Throwable t = null;
try {
engine = (ORMEngine) ClassUtil.loadInstance(cdORMEngine.getClazz());
engine.init(pc);
} catch (ClassException ce) {
t = ce;
} catch (BundleException be) {
t = be;
} catch (NoClassDefFoundError ncfe) {
t = ncfe;
}
if (t != null) {
ApplicationException ae = new ApplicationException("cannot initialize ORM Engine [" + cdORMEngine + "], make sure you have added all the required jar files");
ae.setStackTrace(t.getStackTrace());
ae.setDetail(t.getMessage());
}
ormengines.put(name, engine);
/*}
catch (PageException pe) {
throw pe;
}*/
}
return engine;
}
use of lucee.runtime.orm.ORMEngine in project Lucee by lucee.
the class ConfigImpl method resetORMEngine.
public ORMEngine resetORMEngine(PageContext pc, boolean force) throws PageException {
// String name = pc.getApplicationContext().getName();
// ormengines.remove(name);
ORMEngine e = getORMEngine(pc);
e.reload(pc, force);
return e;
}
Aggregations