users@glassfish.java.net

Re: Servlet receives empty object from Remote EJB3 Session Bean

From: <glassfish_at_javadesktop.org>
Date: Wed, 21 Apr 2010 10:32:46 PDT

Ok, I found out what's going on, but this is sort of embarrassing ...

It turns out, I have been ignoring a nice little warning regarding the use of Vector as type of a field that holds a @xxToMany relationship with FetchType.LAZY:

Element [field someField] within entity class [class Campaign] uses a collection type [class java.util.Vector] when the JPA specification only supports java.util.Collection, java.util.Set, java.util.List, or java.util.Map. This type is supported with eager loading; using lazy loading with this collection type requires additional configuration and an IndirectContainer implementation that extends [class java.util.Vector] or setting the mapping to use basic indirection and the type to be ValueholderInterface.

Two possible solutions can fix my behaviour:

    * use FetchType.EAGER (then I could stay with Vector)
    * use List (as the spec says...)
[Message sent by forum member 'hverbeek']

http://forums.java.net/jive/thread.jspa?messageID=398260