Hi All, I am calling sessionFactory.getCurrentSession() in a thread many times(Current Session). May I know is there any performance issue to access the session from thread local for each time ? Suggest me, which one is best way,
Way1: ===== public void update(){ Session session=sessionFactory.getCurrentSession() ; ............ ............ updateMaster(); } public void updateMaster(){ Session session=sessionFactory.getCurrentSession() ; ............ ............ }
or
Way2: ===== public void update(){ Session session=sessionFactory.getCurrentSession() ; ............ ............ updateMaster(session); } public void updateMaster(Session session){ ............ ............ }
|