Phenomenon
==========
We are shifting the EJB application made by the specification of EJB2.1 from WebLogic to JBossAS7.1.
Then, the problem occurs.
The value is set in ArrayList with EntityBean, and it returns it to Collection of SessionBean.
However, the problem returned in order of the row that is not the order of the set in ArrayList when returning to SessionBean occurs.
SessionBean of the receiver hopes to receive it without changing the arrangement of the set with EntityBean.
In JBoss, the class that can handle it by the Collection interface
(
For Example ,
List ( ArrayList / LinkedList / Vector ),
Set ( HashSet / TreeSet ) and
Map ( HashMap / TreeMap )
)
is put again in HashSet.
And the returned value is returned when called by the finder method of EntityBean.
Is this a specification?
When we proceed with the investigation from StackTrace, processing that put the object again in HashSet was done in [EntityBeanHomeFinderInterceptorFactory.java] .
The class that can handle it by the Collection interface seems to be putting it in HashSet for the Collection interface.
Reference
=========
Enterprise JavaBeansTM Specification and Version 2.1 specifications
http://download.oracle.com/otn-pub/jcp/ejb-2.1-fr-spec-oth-JSpec/ejb-2_1-fr-spec.pdf
Chapter of "12.1.8.2 Multi-Object Finders"
The Bean Provider can choose two types to define a collection type for a finder:
the Java(TM) 2 java.util.Collection interface
the JDK(TM) 1.1 java.util.Enumeration interface
A Bean Provider targeting containers and clients based on Java 2 should use the java.util.Collection
interface for the finder's result type.
- duplicates
-
AS7-4772 Maintain iteration order for entity bean finders
- Resolved