Hi,
If your are using the Minerva pools, please be
aware that the real DB connection is being held
internally until the transaction is also
terminated.
Real XA datasources do not have this problem.
Best Regards,
Ole Husgaard.
Paul Russo wrote:
>
> Hi,
>
> I'm having a problem with cursors being left open. Is there something I
> can do to fource a cursor to be closed before returning the open db
> connection to the pool?
> I'm closing the ResultsSet and PreparedStatement before releasing the db
> connection. I know Oracle has a built in caching mechinism but the
> cursor should get closed. After a while, since cursors are not closing,
> the app fails with 'Too many cursror open". I have a debugging tool
> that also shows open cursors increasing as I use the app but never
> getting closed. Please HELP ;(
>
> Here is the mbean for the db pool followed by a snippet from a session
> bean.
>
> <mbean
> name="DefaultDomain:service=XADataSource,name=xa.QspEjbPool">
> <attribute name="TimestampUsed">false</attribute>
> <attribute name="Password">****MyPassword****</attribute>
> <attribute name="MaxSize">0</attribute>
> <attribute name="InvalidateOnError">false</attribute>
> <attribute name="IdleTimeout">1800000</attribute>
> <attribute name="GCInterval">120000</attribute>
> <attribute name="Blocking">false</attribute>
> <attribute name="LoggingEnabled">false</attribute>
> <attribute name="IdleTimeoutEnabled">false</attribute>
> <attribute name="GCEnabled">false</attribute>
> <attribute name="URL">****MyUrlString*****</attribute>
> <attribute name="Properties"></attribute>
> <attribute name="MinSize">0</attribute>
> <attribute name="MaxIdleTimeoutPercent">1.0</attribute>
> <attribute name="JDBCUser">***MyUser****</attribute>
> <attribute name="GCMinIdleTime">1200000</attribute>
> </mbean>
>
> ------------------------------------------------------------------------------
>
> log("findByAcct");
> List list = new ArrayList();
> Connection connection = getConnection(); //grab from the pool
>
> PreparedStatement ps = null;
>
> try {
> String sql =
> "SELECT "
> + "NAME, "
> + "ACCT "
> + "FROM TBCCUST "
> + "WHERE "
> + "CMPY= '" + cmpy + "' "
> + "AND LEDGR= '" + ledgr + "' "
> + "AND UPPER(ACCT) Like UPPER('%" + acct + "%') "
> + "Order by ACCT";
>
> ps = connection.prepareStatement(sql);
>
> log(sql);
> ps.executeQuery();
> ResultSet rs = ps.getResultSet();
>
> //add custBeans to the list
> CustBean custBean = null;
> String[] s;
> if (rs != null) {
> while (rs.next()) {
> custBean = new CustBean();
> custBean.name = rs.getString("NAME");
> custBean.acct = rs.getString("ACCT");
> list.add(custBean);
> }
> rs.close();
> }
> } catch (SQLException sqe) {
> log("SQLException: " + sqe);
> throw new RemoteException(sqe.getMessage());
> } finally {
> try {
> ps.close();
> closeConnection(); //return to the pool
> } catch (Exception e) {e.printStackTrace();}
> }
> return list;
> }
>
> Thanks for you time.
> Paul-
>
> --
> --------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> List Help?: [EMAIL PROTECTED]
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
List Help?: [EMAIL PROTECTED]