What is the proper way to use DslContext. Does having bean autoconfiguration, or calling DSL.using() method directly before execution; Do they vary in performance ?
@Autowired DataSource dataSource;
@PostConstruct
@Bean(name = "ExecutorDslContext")
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public DSLContext executorDslContext() {
return DSL.using(dataSource, SQLDialect.MEMSQL);
}
Should the Scope be Prototype or Singleton ?
What's the impact of using above mentioned bean for execution vs
Result<Record> result = DSL.using(...).select().from(TABLE);