Can Spring JDBC DataClassRowMapper / BeanPropertyRowMapper be used as a singleton

648 Views Asked by At

Springs DataClassRowMapper seems to be thread safe.

However all examples I see, are constructing new instances on every use.

It is doing reflection on construction, so there is some costs on constructing it.

Can we create singleton instances for DataClassRowMappers per type, and reuse them for every query?

0

There are 0 best solutions below