You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by "Thomas Lien (JIRA)" <ji...@apache.org> on 2018/09/11 15:27:00 UTC

[jira] [Created] (TOMEE-2234) BMP finder returning more than 256 entities

Thomas Lien created TOMEE-2234:
----------------------------------

             Summary: BMP finder returning more than 256 entities
                 Key: TOMEE-2234
                 URL: https://issues.apache.org/jira/browse/TOMEE-2234
             Project: TomEE
          Issue Type: Bug
          Components: TomEE Core Server
    Affects Versions: 7.0.5, 1.7.3
            Reporter: Thomas Lien


Running into a situation where calling an EJB2 BMP finder method that returns more than 256 entities causes subsequent finder calls in the same sessionbean transaction to fail.

 
{code:java}
BigFinderHome bigFinderHome = (BigFinderHome)lookup("BigFinderHome");
LittleFinderHome littleFinderHome = (LittleFinderHome)lookup("LittleFinderHome");
for (int i = 1; i < 300; ++i) {
  // this is a test finder that returns "i" number of entities
  // once this returns more than 256 it causes the littleFinderHome.findAll
  // to return BigFinder entities instead of the LittleFinder entities!
  bigFinderHome.findN(i);
  Collection littleList = littleFinderHome.findAll();
  for (Object obj: littleList) {
    StringBuilder msg = new StringBuilder();
    if (!(obj instanceof LittleFinder)) {
      msg.append("Failed with " + i + " records. LittleFinder Remote is actually " + obj.getClass().getName() + " Implemented interfaces " + Arrays.toString(obj.getClass().getInterfaces()));
    if (obj instanceof EJBObject) {
      Object pk = ((EJBObject)obj).getPrimaryKey();
      msg.append(" Primary key value is " + pk);
    }
    throw new EJBException(msg.toString());
  }
}
{code}
 

I can replicate this 100% of the time by deploying the attached ztest.ear application and running the FinderTestBean.main function (same as the above code). I have tried this on TomEE versions 1.7.3 and 7.0.5 and they both have the error.

The error output of my test is as follows

09-07 12:25:13 [SEVERE] EjbTransactionUtil.handleSystemException: Failed with 257 records. LittleFinder Remote is actually com.sun.proxy.$Proxy142 Implemented interfaces [interface ztest.BigFinder, interface java.io.Serializable, interface org.apache.openejb.core.ivm.IntraVmProxy] Primary key value is 1



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)