anjana wrote:
I am using hibernate from within a managed weblogic server.
All my queries are read-only
Is it necessary to use
s = openSession();
t = s.beginTransaction();
<logic>
t.commit();
s.close();
or
s = openSession();
<logic>
s.close();
should suffice.
Does hibernate set autoCommit to false ?
If you're doing Read-Only, you won't need to start a transaction. Transactions are good for making sure all logic within that transaction is completed as a whole. Think of a Transaction as single unit of work.