I just have a projet to use hibernate to mapping the data on Oracle, it's a web based application. I use Resin as the server. after it runs a few hours, there is the error:
Code:
Cannot open connection: ORA-00604: error occurred at recursive SQL level 1
ORA-00018: maximum number of sessions exceeded
I use a hibernate configure file: hib.cfg.xml like
Code:
<property name="hibernate.dialect">net.sf.hibernate.dialect.OracleDialect</property>
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="connection.url">jdbc:oracle:thin:@xxx.xxx.com:8888:what</property>
<property name="connection.username">you</property>
<property name="connection.password">me</property>
<property name="query.substitutions">true=1, false=0</property>
<property name="show_sql">true</property>
<property name="use_outer_join">true</property>
<property name="jdbc.fetch_size">50</property>
<property name="jdbc.batch_size">20</property>
<property name="jdbc.use_streams_for_binary">true</property>
and use a singleton SessionManager class to make SessionFactory.
On web tier I use cache for a session through every request then on the end of a request close the session. which means during a request only call
Code:
s = SessionManager.getInstance().openSession();
once; and at end call
Code:
s.disconnect(); s.close();
I'v tried to use resin's connection pool but it always the same, after a period of time it reports can't open connection from full pool!
what should i do? thank's for any help!