db4o open source object database
db4o :: Product News Blog

Syndicate This

Saturday, April 29, 2006

db4o 5.3 development release

db4o version 5.3 has been made available on the db4o downloadcenter page.

The new alias feature to translate classes, namespaces and package names between application and database opens a wide range of usecases. Here are some examples:

// Creating an alias for a single class
Db4o.configure().addAlias(
new TypeAlias("com.f1.Pilot", "com.f1.Driver"));

// Accessing a .NET assembly from a Java package
Db4o.configure().addAlias(
new WildcardAlias(
"com.f1.*, F1RaceAssembly",
"com.f1.*"));

// Using a different local .NET assembly
Db4o.Configure().AddAlias(
new WildcardAlias(
"com.f1.*, F1RaceAssembly",
"com.f1.*, RaceClient"));

// Mapping a Java package onto another
Db4o.configure().addAlias(
new WildcardAlias(
"com.f1.*",
"com.f1.client*"));


Aliases underline db4o's capability to access the same database concurrently from any platform, Java or .NET.

Aliases also are very helpful for the use of db4o with ASP.NET projects in Microsoft Visual Studio 2005 express edition, since this IDE dynamically generates different package names for different compilations of the same application. By asking the system for the current package name on the start of the application and creating an alias accordingly, db4o can now be perfectly used with VS express edition.


Class aliases have been used to enhance ObjectManager 1.8 (available here), the db4o database browser. ObjectManager is in fact a Java application to browse .NET databases, a nice demonstration of crossplatform capabilities. ObjectManager 1.8 comes with new functionality to delete objects.


Quite a lot of work for version db4o 5.3 has gone into improving Compactframework 2.0 compatibility. By providing a compile-time enhancement tool (db4o-5.3/bin/CFNativeQueriesEnabler.exe) we have managed to overcome a limitation with reflection on CompactFramework. Native Query syntax can now be used on CompactFramework 2.0 exactly in the same way as for .NET 2.0. The enhancer tool is documented in chapter 22 of the tutorial, with a nice explanation on how enhancing can be seamlessly integrated with the build process of of Visual Studio 2005. Support for generics on CompactFramework 2.0 has also been considerably improved.


While working on dRS (db4o Replication System, also available here) we came up with an idea, how UUIDs and version numbers can also be used to provide information about the creation time and the modification time of an object. We have changed the generation of both number circles accordingly. Here is some pseudocode that explains how to get at the time values. In a future release we will make access a little more convenient.

// To turn generation of UUIDs and version numbers on.
Db4o.configure().generateUUIDs()
Db4o.configure().generateVersionNumbers()

// How to get at time values.
ObjectInfo objectInfo = objectContainer.ext().getObjectInfo(object);
long uuidLongPart = objectInfo.getUUID().getLongPart();
long versionNumber = objectInfo.getVersion();
long creationTimeInMillis =
TimeStampIdGenerator.idToMilliseconds(uuidLongPart);
long modificationTimeInMillis =
TimeStampIdGenerator.idToMilliseconds(versionNumber);

// Converting Java milliseconds to .NET ticks
long creationTimeInDotnetTicks =
new j4o.util.Date(creationTimeInMillis).GetTicks();



Enjoy the new version!

Development for version 5.4 is already well under way. There will be a strong focus on performance enhancements. Recent refactorings are already visible in our CVS.