Performance degradation when reusing DSLContext in jooq

非 Y 不嫁゛ 提交于 2019-12-11 08:29:06

问题


Recently we encountered a performance degradation and in some cases even partial results, once we have transitioned from recreating the DSLContext on every call to creating it once and reusing it. Practically we transitioned from this -

  //Method call  
  try (Connection c = dataSource.getConnection()) {
          DSLContext dsl = DSL.using(c);
          return dsl.select().from(view).where(condition).fetchSize(1000).fetchLazy();
        }

to this -

//Ctor
this.dsl = DSL.using(dataSource, SQLDialect.DEFAULT);

//Method call  
dsl.select().from(view).where(condition).getQuery().fetchSize(1000).fetchLazy();

Was hoping to get some lead what could cause this.

来源:https://stackoverflow.com/questions/57875498/performance-degradation-when-reusing-dslcontext-in-jooq

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!