![](/img/trans.png)
[英]ORA-12519, TNS:no appropriate service handler found while inserting into Oracle Database with X threads
[英]oracle - ORA-12519, TNS:no appropriate service handler found
我已經編寫了一個代碼來連接到oracle數據庫並檢索一些數據。 我打開了會話並正確關閉了它,但看來它沒有正確關閉。 我通過查詢發現它可以得到活動會話的總數,並且它的增加非常奇怪。 我的獲取數據和查詢非活動會話的代碼如下。 它似乎session.close()函數不起作用,但我不知道為什么? 我正在使用Glassfish,JSF和10g oracle數據庫。
select count(s.status) INACTIVE_SESSIONS
from gv$session s, v$process p
where
p.addr=s.paddr and
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();
} finally {
sess.flush();
sess.close();
}
return l;
}
在休眠配置文件中使用以下property
,因此您無需顯式關閉會話。
<property name="current_session_context_class">thread</property>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.