cancel
Showing results for 
Search instead for 
Did you mean: 

BaseEJBException in LazyReferenceIterator

Former Member
0 Kudos

Hi,

I am currently migrating from JBoss to WebAS 6.40 SP15. The components are deployed and the server

is configured accordingly. An Oracle XA Datasource is configured using Vendor SQL and the 10.2.0.1.0 Driver

is registered. The datasource works, which was tested by executing sample queries.

I have the following situation. Bean A has a 1-To-Many Relation to Bean B. While iterating the collection

of Bean Bs, a BaseEJBException is thrown:

+Failed to load the collection in the one-to-many relationship.

+

      
Iterator localIFIter = localIFCollection.iterator();

while (localIFIter.hasNext()) {
  try {
    EJBLocalObject entityLocal = (EJBLocalObject) localIFIter.next();
    entityLocal.setInternalCMRInfo(localCMRInfo);
    col.add(entityLocal.getDetails());
   } catch (Exception e) {
    System.err.println(e)
   }
}

The member localIFCollection is an object of class

com.sap.engine.services.ejb.entity.pm.multiple.ReferenceCollection. The localIFIter is an object of class com.sap.engine.services.ejb.entity.pm.multiple.LazyReferenceIterator.

It iterates just fine til the moment when the iterator does not have a next element.

The exceptions BaseExceptionInfo contains the following cause trace:

java.sql.SQLException: ORA-01002: FETCH auf ungültigen oder geschlossenen Cursor.


	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:145)
	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
	at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
	at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:213)
	at oracle.jdbc.driver.T4CPreparedStatement.fetch(T4CPreparedStatement.java:1211)
	at oracle.jdbc.driver.OracleResultSetImpl.close_or_fetch_from_next(OracleResultSetImpl.java:373)
	at oracle.jdbc.driver.OracleResultSetImpl.next(OracleResultSetImpl.java:284)
	at com.sap.engine.services.ejb.entity.pm.multiple.LazyReferenceIterator.fetchRSToFirstNotAlreadyAddedRow(LazyReferenceIterator.java:180)
	at com.sap.engine.services.ejb.entity.pm.multiple.LazyReferenceIterator.hasNext(LazyReferenceIterator.java:93)
	at com.myCompany.myBean.getCMRRelatedCollectionFullCascade(myBeanBean.java:6363)
	at [...]

It looks to me as if the LazyReferenceIterator tries another fetch despite of the fact that there are no rows

left in the Resultset. Does anybody happen to run into the same problem?

any help is appreciated

best regards

Marcel

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member589677
Discoverer
0 Kudos

Dear Marcel,

you are right, the problem appears while fetching the next element of the ResultSet but there are no more rows.

While invoking the next method of the result set object it tries to get the next element and if there ar not such then the result set must close its resources. This is performed in the oracle.jdbc.driver.OracleResultSetImpl.close_or_fetch_from_next(...) method.

We will investigate the problem in details but first thing which must be checked is the Oracle 10.2.0.1.0 Driver correctness and compatibility. May be this problem appears only with this driver version.

There is a workaround of this problem but then the lazy loading functionality will not be available.

You can use the Collection.size() method in order to determine in advance the count of ResultSet.next() invocations (to use 'for' cycle insted of 'while' cycle).

But invoking of Collection.size() method forces the full collection loading.

I hope it helps.

Best Regards,

Krasimir Topchiyski

Former Member
0 Kudos

Dear Krasimir,

thanks for the reply. I switched the deployed Oracle driver to Version 10.1.0.4.0, still the same problem. Which Oracle driver version is verified by SAP to work with WebAS 6.40 SP15? Here is the manifest information of the Oracle driver used:

Manifest-Version: 1.0
Implementation-Version: "Oracle JDBC Driver version - 10.1.0.4.0"
Specification-Title:    "Oracle JDBC driver classes for use with JDK1.
 4"
Specification-Version:  "Oracle JDBC Driver version - 10.1.0.4.0"
Implementation-Title:   "ojdbc14.jar"
Created-By: 1.2.2 (Sun Microsystems Inc.)
Implementation-Time:    "Wed Feb  9 21:03:39 2005"
Implementation-Vendor:  "Oracle Corporation"
Specification-Vendor:   "Oracle Corporation" .

The problem still occurs. I will check if your your proposed workaround does the job for us.

regards

Marcel

Former Member
0 Kudos

Hi,

the workaround did the job for now. Please keep me informed about your investigation results, and if possible provide me the appropriate patch.

best regards

Marcel