Quantcast
Channel: Spring Community Forums - Data
Viewing all articles
Browse latest Browse all 297

Are Session Automatically Closed when Exception Occurs

$
0
0
Hi all,
I am using Declarative Transactional Support in spring,basically all the service classes are annotated with @Transactional and in code I am using this
Code:

Session session=getHibernateTemplate().getSessionFactory().getCurrentSession();
Now in one of the DAO method Exception is thrown deliberately if object is not found in DB. Can somebody please let me know whether it would result in automatic closing of session or I need to close the session manually when some exception is thrown by DAO layer ?

Viewing all articles
Browse latest Browse all 297

Trending Articles