About fetch

forum_thread

LAZY @ManyToOne field functions as EAGER

In the code example below (also attached) I would like to understand why I am able to print to console a lazy @ManyToOne field after the entity manager closes. There is a switch DO_VIEW_BEFORE_CLOSE, and when it is true the fields are accessed and output before the finding entity manager closes and as expected both a LAZY @ManyToOne field and an EAGER @ManyToOne field are viewable: b.cLazy:{C}[2]"cLazy"
 b.cEager:{C}[3]"cEager" ... entity manager closes, when it is marked as @ManyToOne(fetch=FetchType.LAZY) ?   package com. greensoft . ... }   @ ManyToOne ( fetch = FetchType . LAZY , cascade = CascadeType . ...

 
forum_thread

Failed to read the value of field using reflection

I have recently encountered an issue with reading objects: ... generates the above error. It seems like it is trying to fetch all the characters from the database first, and failed to do so. ...

 
forum_thread

Changes in detach behaviour?

Hello! Today i upgraded to 2.3.5_04. My program stopped working. After some debugging i found out that all fields of retrieved objects are on their default value till i first call a getter or detach them explicitly. Up to 2.3.4 they where initialized immediately. The problem in my case is that i have a Spring DAO. It does the following: I call for example getUserByName("blub). ... The last builds include fixes for some fetch issues so it is possible that ObjectDB behaves differently now. ... Loading of collections may require setting EAGER fetch explicitly. How is getUserByName implemented? Can you provide ...

 
forum_thread

TreeSet and compareTo() issue

Hi I'm trying to use TreeSet but getting NPE on the compareTo() method when it does a find(): ... a collection field in another class that uses eager fetch: @ OneToMany ( fetch = FetchType . EAGER ) private ... test valid: @ OneToMany ( fetch = FetchType . EAGER , cascade = CascadeType . ...

 
forum_thread

Exception on creation when running multithreaded

Hi, I'm trying to test the creation of an object from my datamodel(Organisation) and the creation process includes the creation of an acl for the newly created organisation all in the same transaction. The process is as followed: 1. The organisation gets created 2. The acl is being searched to check if it already exists 3. if it exists it will be updated, otherwise it will be created   ... <finalPlans > <fatchPlan plan = "fetch(index(-101[all]))" eval = "5.1439" var = "1" prm = "0" ... > <fatchPlan plan = "fetch(index(-107[pos<1> :1->:1:notNull]))" eval="4.3054" var="1" ...

 
forum_thread

Criteria query error: Unexpected query token

Using JPA2, I can save entities now in JBoss, and also fetch them uniquely by id. However, if I try to fetch it by getting back all instances (e.g. findAll, I get the following error:   ... Using JPA2, I can save entities now in JBoss, and also fetch them uniquely by id. However, if I try to fetch it by getting back all instances (e.g. findAll, I get the following ...

 
forum_thread

Broken @ManyToOne reference

Hi, I have objects of type A belonging to objects of type B, defined as follows: @MappedSuperclass public abstract class A {   @Id   @ManyToOne(fetch = FetchType.EAGER, cascade=CascadeType.ALL, optional=false)   private B b;   @Id   @Column(length = 36)   private String stringId; } @MappedSuperclass public abstract class B {   @Id   private String name; } ... @ Id @ ManyToOne ( fetch = FetchType . EAGER , cascade = CascadeType . ...   // @Id @ ManyToOne ( fetch = FetchType . EAGER ) public AbstractParent ...

 
forum_thread

Removing an entity throws exception

Hi all, I'm testing ObjectDB for my project, but I have troubles with it. At this time I'm not able to remove customer entity, when it's read by a query (it's attached), it throws this exception: Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: com.objectdb.o._RollbackException: Failed to commit transaction: 51 ... ... ( cascade = CascadeType . ALL , fetch = FetchType . EAGER , optional = false ... OneToMany ( mappedBy = "customer" , fetch = FetchType . LAZY ) private ...

 
forum_thread

Performance problem

Hi, we have a strange performance problem with ObjectDB 2.5.3_01 and JBoss 7.1.1. We have two ObjectDB databases on one ObjectDB server. Production database is running 5-10 times slower than test database. Their size and number of records are almost identical. When running production database in separate test environment its speed is very good. We did a performance analysis on our 2 linux servers one running JBOSS and other running ObjectDB. - CPU utilization of JBOSS server is max 5-10% (per core)... that simple query, but probably due to a massive EAGER fetch that follows the query execution. That eager fetch doesn't happen for example when the query is run the Explorer, and in ...

 
release

2.2.3

... JavaDoc Reference Page...  (for setting eager fetch of non entity collections, such as List<String> ). Improved performance of eager fetch in queries. Added Maven build enhancement to the ...