Quantcast
Channel: Spring Community Forums - Data
Viewing all articles
Browse latest Browse all 297

Shouldn't HibernateJpaDialect.prepareTransaction call session.setDefaultReadOnly ?

$
0
0
The prepareTransaction method already suppresses hibernate flushing for a read-only transaction by setting session flush mode to FlushMode.MANUAL. Shouldn't this method also call session.setDefaultReadOnly(readOnly) to tell the hibernate session to not waste resources on tracking entities that will never be flushed?

I would insert the line
session.setDefaultReadOnly(readOnly);
just before
return new SessionTransactionData(session, previousFlushMode);

I am looking at spring 3.2.2 source.

Viewing all articles
Browse latest Browse all 297

Trending Articles