java - oracle - ORA-12519, TNS:no appropriate service handler found -


i have written code connect oracle database , retrieve data. opened session , close appearing not closing properly. found query total in active sessions , increasing strange. code data , to query inactive sessions follows. appearing session.close() function not working don't know why? using glassfish, jsf , 10g oracle database.

select count(s.status) inactive_sessions gv$session s, v$process p p.addr=s.paddr , s.status='inactive';  public list<trxtender> getfiledetails() {         java.util.list l = null; try {             sess = sessfactory.opensession();             query q = sess.createquery("from mytable");             l = q.list();             return l;         } catch (hibernateexception hbx) {             hbx.printstacktrace();         } {             sess.flush();             sess.close();         }         return l;     } 

use below property in hibernate configuration file, need not close session explicitly.

<property name="current_session_context_class">thread</property>