read-only transation , why should I use this , how this transaction attribute can help me ? please explain me advantages of using read-only attribute for a transaction, I donto know If I should I use this or not
Yes as previous posters suggest, use when fetching data. If using hibernate, by using this you can avoid having to lazy load things since it keeps the session open until the need of the transaction. The alternative is to set lazy="false" in hibernate which can lead to lots of worse things such as loading huge object graphs when not needed.