Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 787319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T21:10:57+00:00 2026-05-14T21:10:57+00:00

I am a new to db4o. I have a big problem with persistance of

  • 0

I am a new to db4o. I have a big problem with persistance of a graph of objects. I am trying to migrate from old persistance component to new, using db4o.

Before I peristed all objects its graph looked like below (Take a look at Zrodlo.Metadane.abstrakt string field with focused value) [its view from eclipse debuger] with a code:

  ObjectContainer db=Db4o.openFile(DB_FILE);
    try {
        db.store(encja);
        db.commit();            
    } finally{
        db.close();         
    }

alt text

After that, I tried to read it with a code:

ObjectContainer db=Db4o.openFile((DB_FILE));

    try{
        Query q = db.query();
        q.constrain(EncjaDanych.class);
        ObjectSet<Object> objectSet = q.execute();
        logger.debug("objectSet.size" + objectSet.size());
        EncjaDanych encja = (EncjaDanych) objectSet.get(0);
        logger.debug("ENCJA"  + encja.toString());
        return encja;
    }finally{
        db.close();         
    }       

and I got it (picture below) – string field “abstrakt” is null now !!!
alt text

I take a look at it using ObjectManager (picture below) and abstrakt field has not-null value there!!! The same value, that on the 1st picture.

alt text

Please help me 🙂 It is my second day with db4o. Thanks in advance!

I am attaching some code with structure of persisted class:

public class EncjaDanych{
Map mapaIdRepo = new HashMap();
public Map mapaNazwaRepo = new HashMap(); }

!!!!!!!!UPDATED:
When I tried to read only Metadane object (there was only one such a object), it is all right – it’s string field abstrakt could be read correctly.

        try{
        Query q = db.query();
        q.constrain(Metadane.class);
        ObjectSet<Object> objectSet = q.execute();
        logger.error("objectSet.size" + objectSet.size());
        Metadane meta = (Metadane) objectSet.get(0);

        logger.debu("Metadane"  + meta.toString());
        return meta;
    }finally{
        db.close();         
    }       
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T21:10:58+00:00Added an answer on May 14, 2026 at 9:10 pm

    This is a common db4o FAQ, an issue with what db4o calls “activation”. db4o won’t instantiate the entire graph you stored when you load an object from an ObjectContainer. By default, objects are instantiated to depth 5. You can change the default configuration to a higher value, but that is not recommended since it will slow down object loading in principle because the depth will be used everywhere you load an object with a query.

    Two approaches are possible to solve your issue:

    (1) You can activate an object to a desired depth by hand when you need a specific depth.
    db.activate(encja, 10) // 10 is arbitrary

    (2) You can work with Transparent Activation. There are multiple chapters on how to use Transparent Activation (TA) in the db4o tutorial and in the reference documentation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

is it possible in Db4o to load new objects into persistent IObjectContainer? I have
I am new to db4o . I have this question in mind: when the
I have to admit that I'm new to Java and Android. db4o seems to
New to PHP and MySQL, have heard amazing things about this website from Leo
I'm playing around with building a new web application using DB4O - piles of
we are using Db4o in our project. I have some automatic tests where is
New to linux and trying to escape doing this the hard way. I have
I am using db4o 8.0. I have a class PostedMessage{ @Indexed long receivedTime; @Indexed
i'm using db4o with objects: public Tra(String x, int y, int z, int pos,
i have a problem with db4o that i'm unable to fix. i have 2

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.