Hi,
I've noticed that using setParameter of the Query object is much slower than using the "typed" methods like setString(), setLong() etc.
I would expect that from the setParameter() version without the Type parameter because Hibernate needs to find out what Type is actually needed, but even the setParameter() call with the correct Type is slower than the typed method version.
I am using Hibernate 3.2.2. Maybe it is already fixed in the current version?
Is this a know behaviour of this method? If so (and if I'm not wrong ;-)) it would be nice if you could stress the fact in the javadocs of this method.
If you try to implement a generic DAO base class you tend to use the setParameter() method and not the typed ones. This will cause a performance reduction at the basis of all DAO implementations!
My development environment:
Java 1.4.2
Hibernate 3.2.2.
DB: Oracle 10g
Oracle Driver Implementation Version: 10.2.0.3.0
Best regards,
Christian
|