2
休止状態がオープンを閉じることができない状況がありますか接続 ??? Hibernateは接続を閉じることができませんか?
私はを表現10gの にHibernate 3.2.5と Oracleを使用してJSF 2.0アプリケーションを開発しています。固定数のトランザクションの後で、ではなく、はデータベースに接続できません。sqlDeveloperを使用しても接続できません。 Iが検査されるように、この故障前のトランザクションの数は、INIT.ORAでプロセスの数にほぼ等しいです。私はいつもこのような休止状態のセッションで作業:.NETの世界では
try {
session.beginTransaction();
...
} catch (Exception ex) {
Transaction tx = session.getTransaction();
if (tx.isActive()) {
tx.rollback();
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_FATAL, ex.getMessage(), ex.getMessage()));
}
} finally {
session.close();
}
マイhibernate設定
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.dialect">org.hibernate.dialect.OracleDialect</property>
<property name="hibernate.connection.driver_class">oracle.jdbc.OracleDriver</property>
<property name="hibernate.connection.url">jdbc:oracle:thin:@localhost:1521:XE</property>
<property name="hibernate.connection.username">CUSTOMS_G2G</property>
<property name="hibernate.connection.password">123456</property>
<mapping resource="ir/khorasancustoms/g2g/persistance/UserGroup.hbm.xml"/>
<mapping resource="ir/khorasancustoms/g2g/persistance/User.hbm.xml"/>
<mapping resource="ir/khorasancustoms/g2g/persistance/CatalogGroup.hbm.xml"/>
<mapping resource="ir/khorasancustoms/g2g/persistance/CatalogValue.hbm.xml"/>
<mapping resource="ir/khorasancustoms/g2g/persistance/gates/Receipt.hbm.xml"/>
<mapping resource="ir/khorasancustoms/g2g/persistance/gates/Price.hbm.xml"/>
<mapping resource="ir/khorasancustoms/g2g/persistance/gates/Promise.hbm.xml"/>
<mapping resource="ir/khorasancustoms/g2g/persistance/gates/Exit.hbm.xml"/>
<mapping resource="ir/khorasancustoms/g2g/persistance/gates/Weight.hbm.xml"/>
<mapping resource="ir/khorasancustoms/g2g/persistance/gates/Fee.hbm.xml"/>
<mapping resource="ir/khorasancustoms/g2g/persistance/Page.hbm.xml"/>
<mapping resource="ir/khorasancustoms/g2g/persistance/Permission.hbm.xml"/>
</session-factory>
</hibernate-configuration>