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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:49:47+00:00 2026-05-26T21:49:47+00:00

is it possible in Db4o to load new objects into persistent IObjectContainer? I have

  • 0

is it possible in Db4o to load new objects into persistent IObjectContainer?

I have a desktop application which opens one connection (IObjectContainer) when started. if I query all objects with:

var objects = from DummyClass foo in session
              select foo

it selects all objects perfectly. However, if another client adds new classes after this, the same query still selects the same objects, without new ones.

I also know about:

session.Ext().Refresh(obj, int.MaxValue);

but I don’t have even not activated references to new objects so there. How to refresh new objects?

Just note: I don’t want to open/close session every time I need some data, I want to take advantage of OODB (Transparent activation, object persistance since loaded etc.)

Thank you

UPDATE (code example for better understanding)

// store one class to fill database with some data
using (var mainSession = SessionFactory.CreateNewConnection())
{
    mainSession.Store(new DummyClass());
    mainSession.Commit();
}

using (var mainSession = SessionFactory.CreateNewConnection())
{
    // returns one object
    var objects = from DummyClass foo in session
                 select foo;
    using (var secondSession = SessionFactory.CreateNewConnection())
    {
        secondSession.Store(new DummyClass());
        secondSession.Commit();
    }

    // this loop reload objects known for mainSession (which is not new object)
    foreach (var obj in objects2)
    {
        mainSession.Ext().Refresh(obj, int.MaxValue);
    }

    // new DummyClass is commited but still not visible (Read-Commited isolation)
    // returns one object
    var objects2 = from DummyClass foo in session
                  select foo;
}

using (var mainSession = SessionFactory.CreateNewConnection())
{
    // returns two objects
    var objects = from DummyClass foo in session
                 select foo;
}

I need something like:

// refresh all objects of DummyClass
session.Ext().Refresh(typeof(DummyClass), int.MaxValue);
  • 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-26T21:49:48+00:00Added an answer on May 26, 2026 at 9:49 pm

    You may use Commited events:

    using Db4objects.Db4o;
    using Db4objects.Db4o.Events;
    using Db4objects.Db4o.IO;
    using Db4objects.Db4o.Ext;
    
    namespace PushedUpdates
    {
        class Program
        {
            static void Main()
            {
                var config = Db4oEmbedded.NewConfiguration();
                config.File.Storage = new MemoryStorage();
                var container = Db4oEmbedded.OpenFile(config, "IN-MEMORY");
    
                var client = container.Ext().OpenSession();
    
                var clientEvents = EventRegistryFactory.ForObjectContainer(client);
                clientEvents.Committed += (s, a) =>
                                            {
                                                foreach(IObjectInfo added in a.Added)
                                                {
                                                    System.Console.WriteLine(added.GetObject());
                                                }
                                            };
    
                container.Store(new Item { Value = 1 } );
                container.Commit();
                container.Store(new Item { Value = 2 });
                container.Commit();
                container.Store(new Item { Value = 3 });
                container.Commit();
    
                client.Close();
                container.Close();
            }
        }
    
        class Item
        {
            public int Value { get; set; }
    
            public override string ToString()
            {
                return "" + Value;
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: NAnt or MSBuild, which one to choose and when? What is the
I didn't find anywhere whether is possible to query from Db4o all objects implementing
I've a java web server application which updates objects to the database every 10
I have a web application which displays set of components in the form of
Possible Duplicate: Python urllib2 Progress Hook I have a script which uploads a file
Possible Duplicate: Split A4 PDF page into two A5 and back again I have
I'm new to db4o and i'm trying to figure out if it's possible to
Possible Duplicate: How does the Google Did you mean? Algorithm work? Suppose you have
Possible Duplicate: regex for URL including query string I have a text or message.
Possible Duplicate: thread with multiple parameters How does one thread a sub with two

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.