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 6531873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:55:52+00:00 2026-05-25T09:55:52+00:00

I’m learning db4o data base, I’m planing to use it 3-tier project. I don’t

  • 0

I’m learning db4o data base, I’m planing to use it 3-tier project.

I don’t fully understand the concept of object identity in db4o.

Suppose we have a class like this:

public class User
{
    public Guid Id;
    public String SomeString;
    public Int64 SomeInt;
    public DateTime SomeDate;
    public DateTimeOffset SomeDateOffset;
    public TimeSpan SomeTimeSpan;
    public User SomeUser;
}

I have load object of type User from the DB and changed all it’s members to new instances. How Db4o will determine what to do with members, when to update (replace) and when to store new instance of them?

According to manual and identity concept, my root object reference remains the same so the root object is updates, all member objects have a new reference so it inserts new instances of them, but in this case we have a space leak, old instances of types String, DateTime, TimeSpan, User etc remains in DB.

We can assume that it deletes objects that get orphaned (is not referenced by anyone), but what about root User object it’s not referenced by anyone, what if I have stored pure DateTime object or Int32 object? Will it flag such explicitly stored object from beeing “GarbageCollected”? This is all just my assumtions, can someone explain how this actually all works?

  • 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-25T09:55:52+00:00Added an answer on May 25, 2026 at 9:55 am

    db4o uses object identity to figure out whenever it needs to insert/update objects. Basically it keeps a list of all objects seen during a session (using RuntimeHelpers.GetHashCode()). When Store() is called db4o simply scan this list looking for a match; if a match is found then the object is updated, otherwise a new object is stored. Note that this operation will be executed recursively (up to the configured update depth).

    Regarding your question about “orphan” objects, db4o does not have a “garbage collector” so its up to the developer to delete objects that are not used anymore.

    Talking specifically about the types you mentioned in your question, string and DateTime will be stored embedded in the parent slot (they will not have an id), so the space required to store them will be reclaimed when it’s parent is deleted; TimeSpan objects will be stored normally (i.e, will have id and so developers need to remove them).

    Basically db4o will embed all primitive types plus any type marshalled through a typehandler that implements IValueTypeHandler in the object’s parent slot (this is not the hole story but is a good approximation :).

    Hope this helps.

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

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
i got an object with contents of html markup in it, for example: string
I want to construct a data frame in an Rcpp function, but when I
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

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.