db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lucas Bergman (JIRA)" <j...@apache.org>
Subject [jira] Created: (OJB-49) references to a forced-refresh class can cause operations on a closed ResultSet
Date Fri, 10 Jun 2005 18:14:48 GMT
references to a forced-refresh class can cause operations on a closed ResultSet

         Key: OJB-49
         URL: http://issues.apache.org/jira/browse/OJB-49
     Project: OJB
        Type: Bug
  Components: PB-API  
    Versions: 1.0.3    
 Environment: Oracle on Linux
    Reporter: Lucas Bergman

When I do a getCollectionByQuery(...) on a class whose returned records reference one or more
classes that have refresh="true" set in the repository configuration, the ResultSet is closed
without the RsIterator knowing about it.  The code path by which the ResultSet is closed is
the following:

	StatementManager.closeResources(Statement, ResultSet) line: 88
	JdbcAccessImpl.materializeObject(ClassDescriptor, Identity) line: 618
	PersistenceBrokerImpl.getDBObject(Identity) line: 1394
	PersistenceBrokerImpl.refreshInstance(Object, Identity, ClassDescriptor) line: 1572
	PersistenceBrokerImpl.doGetObjectByIdentity(Identity) line: 1545
	QueryReferenceBroker.retrieveReference(Object, ClassDescriptor, ObjectReferenceDescriptor,
boolean) line: 382
	QueryReferenceBroker.retrieveReferences(Object, ClassDescriptor, boolean) line: 447
	RsIterator.getObjectFromResultSet() line: 480
	RsIterator.next() line: 275
	ReferencePrefetcher(BasePrefetcher).prefetchRelationship(Collection) line: 107
	QueryReferenceBroker.performRetrievalTasks() line: 347
	QueryReferenceBroker.getCollectionByQuery(Class, Class, Query) line: 169
	QueryReferenceBroker.getCollectionByQuery(Class, Query, boolean) line: 251
	QueryReferenceBroker.getCollectionByQuery(Query, boolean) line: 271
	PersistenceBrokerImpl.getCollectionByQuery(Query) line: 1367
	PoolablePersistenceBroker(DelegatingPersistenceBroker).getCollectionByQuery(Query) line:
	PersistenceBrokerHandle(DelegatingPersistenceBroker).getCollectionByQuery(Query) line: 338

Then, on the next call to RsIterator.hasNext(), there will be a fatal (at least with Oracle)
error when next() is called on a closed ResultSet.

I don't have a proper test case right now; this showed up in an application at my work when
we upgraded OJB from 1.0rc6 to 1.0.3.  I wanted to file this bug to get it on the record;
hopefully there's enough information for someone who understands the code paths involved to
have some idea of what's going on.  I'm fairly certain I can come up with a proper test case
if pressed.

Workaround:  Don't set refresh="true" on any classes in your repository configuration.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org

View raw message