Free tools Windows power users keep installed
One-click scans. No signup required.
Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
“Getting Started With db4o” is a historical DZone Refcard for .NET developers, not a current installation guide. Its examples target db4o 7.8-era APIs and an older .NET toolchain. The object-persistence concepts are still useful when maintaining an inherited application, but db4o is best treated as legacy technology—not a default choice for a new production system.
This guide explains what the refcard covers, how its core .NET patterns work, and what to check before running, preserving, or replacing an existing db4o application.
What the DZone refcard covers
DZone Refcard 053, by Stefan Edlich and Eric Falsken, is about persisting .NET object data with db4o. It covers opening a database, storing and retrieving objects, updates and deletes, transactions, queries, activation, configuration, cascading operations, callbacks, and related resources. The page describes db4o 7.8 as current at the time it was written; that is historical context, not a current version recommendation. Read the DZone refcard.
The examples use .NET names such as IObjectContainer, Db4oFactory, and assemblies beginning Db4objects.Db4o. They should not be confused with db4o’s separate Java API.
#1 Best Overall
What db4o was designed to do
db4o is an object database: it was designed to persist application objects and their relationships directly, rather than requiring developers to map each object to relational tables. That differs from an ORM, which maps objects to a relational database; a document database, which persists document-shaped records; and an embedded database, which describes where a database runs. db4o could be used embedded in an application or in client/server configurations.
Its appeal was straightforward object persistence with relatively little database administration. But “store an object” is not the whole persistence story: object identity, graph traversal, activation, transactions, and the application’s class definitions all affect what is stored and retrieved.
Historical .NET setup: do not treat it as a current recipe
The refcard’s setup guidance belongs to an older .NET era. It names Db4objects.Db4o.dll for basic use, with additional assemblies for particular features:
Db4objects.Db4o.CS.dllfor client/server use.Db4objects.Db4o.Linq.dllfor LINQ.Db4objects.Db4o.NativeQueries.dllfor Native Queries.Db4objects.Db4o.Instrumentation.dllfor Transparent Activation.
It also refers to Visual Studio 2008 or later and the .NET 2.0 SDK or later, with .NET 3.5 suggested. Those are archival requirements, not advice to install obsolete frameworks or run an old installer on a production machine. The refcard says the assemblies should be copied locally into the application’s output directory; running them from the Global Assembly Cache was unsupported.
If you must build or run a legacy application, first identify its exact db4o version, runtime, dependencies, and license terms. Recreate the environment in an isolated, reproducible setup and test against copies of database files—not the only production copy.
The basic object lifecycle
The refcard’s central pattern is to open a container, store or query objects, commit deliberate changes, and close the container. This cleaned-up example illustrates the historical API; it is not a verified recipe for a modern .NET project:
Rank #2
IObjectContainer db = Db4oFactory.OpenFile(filename);
try
{
db.Store(new Person("Petra"));
db.Store(new Person("Gallad"));
var results = db.Query<Person>(x => x.Name == "Petra");
Person person = results.First();
person.Name = "Peter";
db.Store(person);
db.Commit();
db.Delete(person);
db.Commit();
}
catch
{
db.Rollback();
throw;
}
finally
{
db.Close();
}
The example separates the update and delete with commits to make the transaction boundary visible. A real application should define transaction boundaries deliberately and handle exceptions according to its recovery requirements. The refcard says a clean close commits uncommitted transactions, but relying on shutdown to commit is a poor reliability habit; commit explicitly and test crash recovery.
In ordinary local-file mode, an open database file is locked, so a second application generally cannot open that same file concurrently. That does not mean db4o had no concurrency options: the refcard also describes embedded-server and client/server modes. Keep those cases distinct, and do not assume an old single-file locking rule describes every deployment mode.
Object identity and updates: values are not identities
A key difference from many relational workflows is db4o’s use of native object identity within a container or connection. If an application retrieves a stored Person, changes that retrieved object, then calls Store, it is working with the same persisted object identity. Creating a new Person("Petra") later does not necessarily mean “find the person whose name is Petra and update that record.” Equal field values are not automatically equivalent to the same persisted object.
This can produce duplicate logical entities if code assumes a business key—such as an email address or customer number—will behave like a database primary key. When maintaining a system, locate where objects are retrieved versus newly constructed, and identify the application logic that enforces uniqueness.
Update depth
The refcard gives a historical default UpdateDepth of 1. In practice, a shallow update does not necessarily discover changes throughout a nested object graph. If a parent refers to a child and the child changes, storing the parent may not persist that deeper change under the default behavior.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →IConfiguration config = Db4oFactory.NewConfiguration();
config.UpdateDepth(depth);
IObjectContainer db = Db4oFactory.OpenFile(config, filename);
The refcard describes UpdateDepth(0) as preventing changes from being saved and int.MaxValue as requesting traversal as deeply as possible. Maximum depth is not a safe global fix: it can traverse large graphs, trigger unexpected persistence, and increase work. Determine the graph and intended update behavior, then test representative changes.
Queries: several styles, different trade-offs
The refcard includes LINQ-style .NET queries, and db4o also offered Query by Example, SODA, and Native Queries. Their broad distinctions are:
| Approach | Why it was used | What to watch |
|---|---|---|
| LINQ / Native Queries | Expressive, familiar query syntax for .NET developers. | Confirm the historical runtime and query support match the application; do not assume current LINQ behavior. |
| SODA | Explicit query construction, useful when building criteria dynamically. | More verbose and tied to db4o’s API. |
| Query by Example | Simple searches based on an example object. | Less suited to complex conditions and nuanced query logic. |
The refcard also discusses indexing fields. An index may matter for query behavior, but it must be configured intentionally and validated against the actual workload. The available historical material does not justify a general performance ranking against relational or other databases.
Activation depth: retrieved does not always mean fully populated
Activation controls how far db4o populates related objects when an object is retrieved. The refcard gives a historical default activation depth of 5. Objects beyond the configured depth can retain default or null field values, so a query may return its immediate result while parts of the related graph remain incomplete.
db.Activate(unactivatedObject, depth);
db.Deactivate(activatedObject, depth);
A too-shallow graph can surface later as a null-reference error, incomplete output, or a mistaken expectation that related data will load automatically. The refcard also shows configuration through ActivationDepth(depth). Test the depth required by real application workflows; do not assume every query returns a fully materialized graph.
Transparent Activation was intended to activate referenced objects on demand by instrumenting compiled classes. The historical process involved enabling it in configuration and running Db4oTool.exe during the build or post-build, with instrumentation and potentially Cecil-related assemblies. This depends on obsolete tooling and build assumptions, so treat it as a legacy feature to understand or preserve—not a portable new-project recommendation.
Deletes, cascading behavior, and transactions
The historical deletion call is db.Delete(anObject), followed by a commit. Deleting one object does not necessarily delete its child objects. Cascading delete must be configured separately, and enabling it carelessly can remove child objects that are shared elsewhere in the graph.
Keep four cases distinct when investigating deletion bugs:
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
- The database entry for the selected object was deleted.
- Related objects may remain because cascading was not enabled.
- Orphaned objects may need an explicit cleanup strategy.
- In-memory references can still point to an object even after its database entry is deleted.
Commit() makes the transaction’s changes persistent; Rollback() cancels uncommitted database changes. The refcard warns that rollback does not necessarily restore already-loaded objects in application memory. A refresh may be needed to reload stored values. Test this behavior rather than treating rollback as an automatic reset of the entire object graph.
Configuration and client/server operation
Class- and field-level configuration in the refcard includes indexing, activation behavior, cascading operations, event callbacks, and transient fields. For example, its indexing pattern is:
IConfiguration config = Db4oFactory.NewConfiguration();
config.ObjectClass(typeof(Customer))
.ObjectField("Name")
.Indexed(true);
These settings have practical consequences: indexes affect query configuration; transient fields define values not to persist; callbacks can add lifecycle behavior; and cascading rules can change how operations affect an object graph. Review them as part of the data model, especially before changing class definitions or exporting data.
The refcard’s historical client/server pattern starts a server and grants access, then connects a client:
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →IObjectServer server = Db4oFactory.OpenServer(filename, port);
server.GrantAccess(username, password);
IObjectContainer client = Db4oFactory.OpenClient(
serverAddress, port, username, password);
It says an available port above 1024 could be used and that port 0 creates an embedded server unavailable to remote clients. These are historical API details. They are not a security recommendation: do not expose an old db4o service directly to the Internet. If a legacy server must run, isolate it, restrict network access, review authentication and backups, and avoid assuming old authentication is adequate for current threat models.
Best Value
Is db4o still a sensible choice?
Current evidence points to db4o as legacy or abandoned technology rather than a routinely maintained mainstream database. The database catalog dbdb.io classifies it as abandoned and records an end year of 2014; this is a catalog assessment, not proof of a formal vendor end-of-life announcement. A community repository such as iboxdb/db4o-gpl can offer source-related material and API documentation, but a fork is not equivalent to official support or a security commitment.
The original refcard links to db4o resources such as downloads, documentation, forums, and a tracker, but they should be treated as historical references unless their current availability is independently confirmed. For licensing, historical db4o materials describe GPL, an open-source compatibility license, and commercial licensing. Do not infer that an old “open source” label gives unrestricted rights for a current commercial deployment; review the exact version’s license files with appropriate legal expertise.
For a new production system, the risks include unclear maintenance, old runtime and tooling assumptions, uncertain compatibility with modern platforms, limited current support, security and recovery questions, and coupling to db4o-specific APIs and object graphs. Use a currently supported relational database and data-access layer when you need broad operational tooling, SQL reporting, multi-language access, or a well-supported upgrade path. For Java object persistence, ObjectDB is one separate product to evaluate, not a drop-in db4o replacement; assess its licensing and support for your own requirements.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsPractical checklist for an inherited db4o application
- Preserve originals. Make immutable backups of database files and verify that restoration works. Perform experiments only on copies.
- Freeze the environment. Record the db4o version, runtime, assemblies, build tools, configuration, and license files. Keep the runtime isolated and reproducible.
- Map persisted types. Inventory classes, fields, transient members, identity assumptions, callbacks, indexes, and cascade settings.
- Test graph behavior. Use representative data to verify activation depth, update depth, deletes, and rollback behavior.
- Export before changing the system. Build an extraction path and compare record counts and checksums where feasible. Do not assume that copying object graphs into another database preserves identity or semantics.
- Review network exposure. Restrict any client/server instance to trusted, isolated networks and assess authentication and backup controls.
- Plan migration deliberately. Define destination types and keys, test class changes and data conversion, and validate recovery and cutover before retiring the original files.
A migration may require more than loading each stored object into a new database. Object identity, activation behavior, transient fields, class renames, and graph relationships can all affect what an export actually contains. Preserve a read-only copy of the source files through the migration and verify the exported data with application-level checks.
Bottom line
The DZone refcard remains a useful map to db4o’s historical .NET model: objects, identity, graph depth, queries, and explicit transactions. Use it to understand or maintain a legacy system, not as evidence that its tooling is current. For new production work, choose a maintained persistence platform unless you have a specific, tested reason to accept db4o’s support, compatibility, and migration risks.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

