[
https://issues.apache.org/jira/browse/TOMEE-2234?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jonathan Gallimore reassigned TOMEE-2234:
-----------------------------------------
Assignee: Jonathan Gallimore
> 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: 1.7.3, 7.0.5
> Reporter: Thomas Lien
> Assignee: Jonathan Gallimore
> Priority: Major
> Attachments: sourcecode.zip, ztest.ear.zip
>
>
> 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) {
> if (!(obj instanceof LittleFinder)) {
> StringBuilder msg = new StringBuilder();
> 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
>
> Note that in my test I am configured to use simple jndi lookup names in the
> system.properties
> openejb.jndiname.format=\\{interfaceClass.simpleName}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)