db4o open source object database
db4o :: Java 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.


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);

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.

Powered by Blogger