views:

45

answers:

2

Will the Hibernate caching(1st, 2nd, or Query) work when I use JdbcTemplate?

I got to know that the caching is one of the advantage in using ORM instead of traditional JDBC. So, If I got to use Hibernate's JdbcTemplate, still can I enjoy the benefits of hibernate caching?

+2  A: 

Since you're bypassing your hibernate altogether, you have to implement/configure those things yourself.

Kurt Du Bois
+1  A: 

No, if you use JdbcTemplate you will be bypassing the cache entirely and will thus need to invalidate it.

GaryF
HibernateTransactionManager to maintain the cache? Can you clarify?
Pascal Thivent
@Pascal: I must have mis-read something. Having re-read the HibernateTranscationManager javadoc, it does nothing of the sort. Removed that part from my answer.
GaryF