About eager

forum_thread

PostUpdate collection null

Hello, I have an entity MyEntity with a collection attribute myCollection. I have an EntityListener on MyEntity with a @PostUpdate method. When I try to access myCollection from the PostUpdate method, this collection is null. If I try to access the collection from the PreUpdate method, the collection is populated. The collection is eagerly fetched. public class MyEntity {     @OneToMany(fetch=FetchType.EAGER)     private ArrayList<OtherEntity> myCollection = new ArrayList<OtherEntity>(); ... {     @OneToMany(fetch=FetchType.EAGER)     private ArrayList<OtherEntity> ... OneToMany ( fetch = FetchType . EAGER , cascade = CascadeType . PERSIST ) ...

 
forum_thread

Can't get arraylist/vector type attributes

I have a class that contains some attributes of type Vector (also tried with ArrayList and same happens). When I try to get an object from that class doing using the find method it works fine, I get the object. But when I call the close method to close the EntityManager the information from the Vector dissapears and I get an empty vector. ... the EntityManager or load it eagerly ( FetchType.EAGER ). See also "objectdb.temp.no-detach" as a possible quick ...

 
forum_thread

Listing large number of complicated objects with paging.

Hi, For last few hours I was working on a problem with bad performance and memory problems with such a simple query: select prod from Product prod order by prod.id ASC Right now I have 55541 'Product' (attached to this post) entities in database and I'm trying to speed listing them with paging. The problem is, that running code that looks like this: ... The problem is probably with the extensive EAGER setting in Product , and particularly with eager fetch of inverse (mapped by) collections. Massive inverse fetch is ...

 
issue

ClassCastException after upgrade to 2.3.5_03

On upgrading to the latest version of objectdb I get the following exception on object retrieval: ... CascadeType . ALL , fetch = FetchType . EAGER ) private Object payload ;   @ OneToOne ... CascadeType . ALL , fetch = FetchType . EAGER ) private Map<String, Object> metadata ;   ... ...

 
forum_thread

EntityManager.refresh takes a long time

EntityManager.refresh takes a long time for entity object Person in this code: ... ManyToMany ( fetch = FetchType . EAGER , cascade = CascadeType . REFRESH ) @ ... = "person" , fetch = FetchType . EAGER , cascade = CascadeType . ALL ) @ NotNull ...

 
forum_thread

Possible issue with Spring JPA and Embedded

Hello, ... detach. Your Spring JPA test passes if you set eager fetch for that collection: @ ElementCollection ( fetch = FetchType . EAGER ) public List<RulePart> getRules ( ) ...

 
forum_thread

@OneToMany(fetch = FetchType.LAZY) list is always null

Hello. @OneToMany(fetch = FetchType.LAZY) doesn't work when using EJB or something else related to J2EE. parent.getChildren() returns null. Here is a simple example: Bean: ... to the no-detach option, because all is OK when using EAGER loading, but when I use LAZY with PersistenceUnit ... to the no-detach option, because all is OK when using EAGER loading, but when I use LAZY with PersistenceUnit (not ... work well in your project you will probably have to use EAGER when necessary. ObjectDB Support ObjectDB ...

 
forum_thread

How to query for list of lists ?

Hi, I have a problem with constructing query, that gets only embedded list of integers from Entity. Here's the example : Query query = em.createQuery("SELECT i.filterDescription FROM Inspiration i"); List<List<Integer>> result = query.getResultList(); where Inspiration is like this : ... ( fetch = FetchType . EAGER ) protected List<Integer> filterDescription ; ... ( fetch = FetchType . EAGER ) private List<String> reviewSnippets ; ...

 
forum_thread

GWT RPC is throwing serialization exception when I have object db date value

Caused by: com.google.gwt.user.client.rpc.SerializationException: Type 'objectdb.java.util.Date' was not included in the set of types which can be serialized by this SerializationPolicy or its Class object could not be loaded. For security purposes, this type will not be serialized.: instance = Sat Jan 29 00:00:00 PST 2011    at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize(ServerSerializationStreamWriter.java:614)  ... OneToMany ( fetch = FetchType . EAGER , cascade = CascadeType . ALL ) private ... you have to load the collection, and using EAGER fetch mode is one way to do that. ObjectDB ...

 
forum_thread

problem with lazy loading - unittest project attached

hi, i'm still testing objectdb together with spring-data-jpa. i made a test which should simulate 4 requests 1. save entity 2. read an existing entity, add onetomany relation 3. read an existing entity, add another onetomany relation 4. read entity, get relations. i have the feeling this is not the optional way to test this, because of the differnt transaction behavior. the test is not transactional, but the spring repository methods are. ... one entity with 2 related entities. if i use EAGER the test pass, if not the related entity list is empty. what am i ...