use of lucee.runtime.type.scope.storage.db.SQLExecutor in project Lucee by lucee.
the class DatasourceStorageScopeCleaner method clean.
private void clean(ConfigWeb config, DataSource dataSource) throws PageException, SQLException {
ConfigWebImpl cwi = (ConfigWebImpl) config;
DatasourceConnection dc = null;
DatasourceConnectionPool pool = cwi.getDatasourceConnectionPool();
try {
dc = pool.getDatasourceConnection(null, dataSource, null, null);
Log log = ((ConfigImpl) config).getLog("scope");
SQLExecutor executor = SQLExecutionFactory.getInstance(dc);
executor.clean(config, dc, type, engine, this, listener, log);
} finally {
if (dc != null)
pool.releaseDatasourceConnection(dc);
}
}
use of lucee.runtime.type.scope.storage.db.SQLExecutor in project Lucee by lucee.
the class StorageScopeDatasource method store.
@Override
public void store(PageContext pc) {
DatasourceConnection dc = null;
ConfigImpl ci = (ConfigImpl) ThreadLocalPageContext.getConfig(pc);
DatasourceConnectionPool pool = ci.getDatasourceConnectionPool();
Log log = ci.getLog("scope");
try {
// FUTURE change method interface
pc = ThreadLocalPageContext.get(pc);
DataSource ds;
if (pc != null)
ds = pc.getDataSource(datasourceName);
else
ds = ci.getDataSource(datasourceName);
dc = pool.getDatasourceConnection(null, ds, null, null);
SQLExecutor executor = SQLExecutionFactory.getInstance(dc);
executor.update(ci, cfid, appName, dc, getType(), sct, getTimeSpan(), log);
} catch (Throwable t) {
ExceptionUtil.rethrowIfNecessary(t);
ScopeContext.error(log, t);
} finally {
if (dc != null)
pool.releaseDatasourceConnection(dc);
}
}
Aggregations