[OJB-developers] RsIterator.releaseDbResources
Brought to you by:
thma
From: Darren S. <Dar...@cw...> - 2002-01-25 10:41:41
|
Hi, We're using Object Bridge 0.7.310 with SQL Server 7.0 (MS SQL Server JDBC drivers) and when indirectly using anything which uses RsIterator the drivers are complaining that the driver object has been closed. Here's the stack trace: java.sql.SQLException: [Microsoft][SQLServer JDBC Driver]Object has been closed. at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source) at com.microsoft.jdbc.base.BaseResultSet.validateClosedState(Unknown Source) at com.microsoft.jdbc.base.BaseResultSet.getStatement(Unknown Source) at ojb.broker.accesslayer.RsIterator.releaseDbResources(RsIterator.java:304) at ojb.broker.accesslayer.RsIterator.hasNext(RsIterator.java:109) at ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBrokerImpl.java:808) at ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBrokerImpl.java:878) at ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBrokerImpl.java:943) at ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBrokerImpl.java:933) The code in RsIterator.releaseDbResources looks like this: try { m_rs.close(); Statement stmt = m_rs.getStatement(); if (stmt != null) { stmt.close(); } m_rs = null; } It appears that the result set is closed before returning the statement that produced it, should this be: Statement stmt = m_rs.getStatement(); m_rs.close(); if (stmt != null) stmt.close(); ... Regards Darren ****************************************************************************************************************************************************** This e-mail has been prepared using information believed by the author to be reliable and accurate, but Thales Information Systems Finance makes no warranty as to accuracy or completeness. In particular Thales Information Systems Finance does not accept responsibility for changes made to this e-mail after it was sent. Any opinions expressed in this document are those of the author and do not necessarily reflect the opinions of the company or its affiliates. They may be subject to change without notice. This e-mail, its content and any files transmitted with it are intended solely for the addressee(s) and may be legally privileged and/or confidential. Access by any other party is unauthorised without the express written permission of the sender. If you have received this e-mail in error you may not copy or use the contents, attachments or information in any way. Please destroy it and contact the sender via the Thales Information Systems Finance switchboard in London at +44 (0) 20 7650 0100 or via e-mail return. This message and any attachments have been scanned for viruses prior to leaving the originators network. The originator does not guarantee the security of this message and will not be responsible for any damages arising from any alteration of this message by a third party or as a result of any virus being passed on. ******************************************************************************************************************************************************* |