Hi,
i use jooq on firebird database, and i try to optimize the global performance.
my datasource is a c3p0 connection pool with statement cache activated.
after a database monitoring i have seen that a i have a lot of prepared statement that like's that :
update "TEST" set "TEST"."A" = cast(? as varchar(3))
update "TEST" set "TEST"."A" = cast(? as varchar(4))
update "TEST" set "TEST"."A" = cast(? as varchar(5))
update "TEST" set "TEST"."A" = cast(? as varchar(6))
update "TEST" set "TEST"."A" = cast(? as varchar(7))
and the code in java like that
public void test(String a) {
getDsl().update(TEST).set(TEST.A, a).execute();
}
main(){
test("123");
test("1234");
....
}
so because the key for statement cache is the sql of the request and as the variable is cast with length, this behaviour generates a lot of prepared statement for the same query.
is there a way to tell to jooq to generate a sql like that update "TEST" set "TEST"."A" = ?
or maybe i don't understand something and other solution will be most valuable.
thanks in advance.
ps : my dsl config is quite simple
org.jooq.impl.DefaultConfiguration res = new DefaultConfiguration();
res.set(connectionProvider()); // default connection provider
res.set(org.jooq.SQLDialect.FIREBIRD);