Hi Everybody, I have used hibernate in my application. I am getting problem as when i log out from the application the session remains inactive and some cursor are open but after some some time the count of cursor and inactive session get reduced. Is there any way so that after logging out the session get completely close. In each method i have used
Session session=HibernateSessionFactory.getSessionFactory().openSession(); try { trnx=session.beginTransaction(); \\ some line of code for querying db trnx.commit(); } catch(Exception e){ if(trnx!=null) trnx.rollback(); log.error(e.getMessage(),e); throw e; } finally{ try{ session.flush(); HibernateSessionFactory.closeSession(); }catch (HibernateException e) { log.error(e.getMessage(),e); throw e; } }
Please suggest to get rid of this issue.
Thanks.. Ajit
|