}
private Executor newExecutor() throws SQLException {
Environment environment = configuration.getEnvironment();
if (environment == null)
throw new ExecutorException("ResultLoader could not load lazily. Environment was not configured.");
DataSource ds = environment.getDataSource();
if (ds == null) throw new ExecutorException("ResultLoader could not load lazily. DataSource was not configured.");
Connection conn = ds.getConnection();
conn = wrapConnection(conn);
Transaction tx = new JdbcTransaction(conn, false);
return configuration.newExecutor(tx, ExecutorType.SIMPLE);
}