Upgrading my project I'm thinking here about transactions.
Well, the thing is I'm not quite sure when should I use the transactions for my Hibernate queries in Spring.
Not that I completely don't understand what transactions are, I guess I do, but
Do I need to use transactions for a get*
type queries just setting the read-only
attribute?
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<!-- all methods starting with 'get' are read-only -->
<tx:method name="get*" read-only="true" />
<!-- other methods use the default transaction settings -->
<tx:method name="*" />
</tx:attributes>
</tx:advice>
Is that efficient for get*
queries?
Because, as far I think, using transactions should be done like for CREATE
, UPDATE
, DELETE
and such queries.
Am I missing something here?