This content has been marked as final.
Show 1 reply
-
1. Re: HibernateContext and Transaction
sviluppatorefico Feb 24, 2005 5:06 PM (in response to ansonau)hi ansonau.....the line
Session hsession = HibernateContext.getSession
is used only in a transaction. It take the current transaction and it continue with it. After if i execute a session.close(), anyhow i have to wait the end of the transaction, if no no commit will be executed.
Then the line
SessionFactory factory = (SessionFactory)
ctx.lookup("java:/hibernate/CaveatEmptorSessionFactory");
create a new transaction and it will be closed by the close() method. No deployment descriptor or other thing can to be used to configure a transaction with hibernate.