183 words

Issue #148 - Lazy loading of mapped by (inverse) singular references

Feature RequestVersion: 2.0.0Priority: NormalStatus: FixedReplies: 1
#1
2012-04-24 08:41

ObjectDB ignores lazy setting of non collection mapped by (inverse) fields and loads them always eagerly. This is allowed by JPA since lazy is only hint but it is not efficient.

The reason is that currently when an entity object is loaded all the referenced objects are instantiated immediately, at least as hollow objects. In order to instantiate referenced objects their exact type is needed. For ordinary reference fields the type of the references is stored within the entity objects, so it is always available. For mapped by (inverse) reference fields no information is stored in the entity object and therefore a query is required. The declared field type cannot be used since the referenced object may be an instance of a subclass.

Future versions of ObjectDB should manage mapped by (inverse) fields differently and avoid immediate instantiation. This will require managing in every entity object with inverse fields tracking which inverse fields have been loaded and references that have not been loaded yet will be set to null.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
support
support's picture
Joined on 2010-05-03
User Post #1,035
#2
2012-11-23 06:50

Lazy loading of mapped by (inverse) singular references is now supported in build 2.4.4_13.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
support
support's picture
Joined on 2010-05-03
User Post #1,340

Post Reply

Please read carefully the posting instructions - before posting to the ObjectDB website.

  • You may have to disable pop up blocking in order to use the toolbar (e.g. in Chrome).
  • Use ctrl + right click to open the browser context menu in the editing area (e.g. for using a browser spell checker).
  • To insert formatted lines (e.g. Java code, stack trace) - select a style in the toolbar and then insert the text in the new created block.
  • Avoid overflow of published source code examples by breaking long lines.
  • You may mark in paragraph code words (e.g. class names) with the code style (can be applied by ctrl + D).
  • Long stack traces (> 50 lines) and complex source examples (> 100 lines) should be posted as attachments.
Attachments:
Maximum file size: 32 MB
Cancel