You *should* always close the OQLQuery yourself. The finalizer is just there
as a fallback and as u mention it is not a good idea to depend on Finalizer
functionality in Java.

Regards,
Low

-----Original Message-----
From: Winston,Alex [mailto:[EMAIL PROTECTED]]
Sent: Saturday, January 19, 2002 4:07
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] Oracle8i Connections.


I happened to track down the source of the problem.  I am not sure if it is
a bug, but I wanted to mention it.  I noticed the FinalizerThread was
locking on the close method in the finalize method from OQLQueryImpl.  I
removed this from castor and explicitly close my OQLQuery and QueryResults
and everything works fine.  Is there any reason why the api doesnt require
users to close the OQLQuery explicitly as finalize methods are never highly
recommended.
Any comments?
Thanks

> -----Original Message-----
> From: Winston,Alex [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 18, 2002 11:28 AM
> To: [EMAIL PROTECTED]
> Subject: [castor-dev] Oracle8i Connections.
> 
> 
> I am experiencing some problems with oracle closing 
> connections.  I will
> list all the information that I have below.
> 
> My application is threaded but we have safely implemented concurrent
> transactions.  As my threads complete and begin closing 
> connections to the
> database there is always an arrent thread that hangs when 
> trying to close
> its connection to oracle.  It is always the last connection 
> that hangs, and
> appears to be random.  Although it appears it might be a 
> deadlock of some
> kind between the Finalizer and the thread.  The stack trace 
> of the thread is
> listed below.
> 
>   [1] oracle.jdbc.driver.OraclePreparedStatement.close
> (OraclePreparedStatement.java:235)
>   [2] oracle.jdbc.driver.OracleConnection.close_statements
> (OracleConnection.java:1,596)
>   [3] oracle.jdbc.driver.OracleConnection.close 
> (OracleConnection.java:899)
>   [4] 
> org.exolab.castor.jdo.engine.TransactionContextImpl.commitConnections
> (TransactionContextImpl.
> java:133)
>   [5] org.exolab.castor.persist.TransactionContext.commit
> (TransactionContext.java:1,532)
>   [6] org.exolab.castor.jdo.engine.DatabaseImpl.commit
> (DatabaseImpl.java:500)
>   [7] com.cnanash.medfees.persistence.MedfeesJDOManager.end
> (MedfeesJDOManager.java:119)
>   [8] 
> com.cnanash.medfees.MedfeesInvoiceManager$ThreadManager$Runner.run
> (MedfeesInvoiceManager.java
> :395)
>   [9] java.lang.Thread.run (Thread.java:539)
> Thread-6[1] where 0x2c0
> 
> Additionally the FinalizerThread is hung the trace is below.
>   [1] oracle.jdbc.driver.OracleConnection.isStmtCacheEnabled
> (OracleConnection.java:2,333)
>   [2] oracle.jdbc.driver.OraclePreparedStatement.privateClose
> (OraclePreparedStatement.java:275)
>   [3] oracle.jdbc.driver.OraclePreparedStatement.close
> (OraclePreparedStatement.java:235)
>   [4] org.exolab.castor.jdo.engine.SQLEngine$SQLQuery.close
> (SQLEngine.java:1,675)
>   [5] org.exolab.castor.jdo.engine.OQLQueryImpl.close
> (OQLQueryImpl.java:520)
>   [6] org.exolab.castor.jdo.engine.OQLQueryImpl.finalize
> (OQLQueryImpl.java:533)
>   [7] java.lang.ref.Finalizer.invokeFinalizeMethod (native method)
>   [8] java.lang.ref.Finalizer.runFinalizer (Finalizer.java:86)
>   [9] java.lang.ref.Finalizer.access$100 (Finalizer.java:17)
>   [10] java.lang.ref.Finalizer$FinalizerThread.run 
> (Finalizer.java:163)
> Finalizer[1]
> 
> If anyone has any ideas they would be very much appreciated.
> Thanks
> 
> > Alex Winston
> > Programmer Analyst, SCP
> > CNA Life Department-Information Technology
> > Software Applications Services
> > [EMAIL PROTECTED]
> > 615-886-6947
> > 
> 
> ----------------------------------------------------------- 
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
>       unsubscribe castor-dev
> 
> 

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to