Spring - Transaction Readonly
Posted
by AAK
on Stack Overflow
See other posts from Stack Overflow
or by AAK
Published on 2010-04-01T18:57:36Z
Indexed on
2010/04/01
19:03 UTC
Read the original article
Hit count: 347
Hello Gurus! Just wanted your expert opinions on declarative transaction management for Spring. Here is my setup - A. DAO Layer is Plain old JDBC using jdbcTemplete (No hibernate etc) B. Service Layer is POJO with declarative trasnactions as follows - save*, readonly=false, rollback for Throwable
Things work fine with above setup. However when I say get*, readonly=true
I see errors in my log file saying - Database connection cannot be marked as readonly. This happens for all get* methods in Service Layer.
Now my questions -
A. Do I have to say get* as readonly? All my get* methods are pure read DB operations. I do not wish to run them in any transaction context. How serious is the above error?
B. When I remove the get* confiiguration, I do not see the errors, morever all my simple get* operations are performed without transactions. Is this the way to go?
C. Why would anyone want to have transactional methods where readonly = true? Is there any practical significance of this configuration?
Thank you! As always your resposes are much appreciated!
© Stack Overflow or respective owner