Questions tagged [db4o]

db4o is an open source embeddable object database for Java and .NET.

As of October 2014 Versant has discontinued the work on db4o due to a decision by Actian, which is the new owner of Versant.

db4o is an simple to use yet powerful object database. It is designed for embedded scenarios and runs on the Java and .NET platform.

You just drop db4o's single programming library (.jar /.dll) into your development environment, open a database file and store any object - no matter how complex - with just one line of code, e.g., in Java:

public void store(Car car) {
  ObjectContainer db = Db4oEmbedded.openFile("car.yap");
  db.store(car);
  db.close();
}

This unmatched ease-of-use results in drastically reduced development time.

Rather than using string-based APIs (such as SQL, OQL, JDOQL, JPAQL, and SODA), Native Queries allow developers to simply use the programming language itself (e.g., Java, C#, or VB.NET) to access the database and thus benefiting from compile-time type checking, the full expressive power of OO-languages, and the great convenience of advanced development environments.

For example, compare this Native Query in C# for .NET 3.5:

IList<Student> students =
  from Student student in container
  where student.Age < 20 && student.Grade == gradeA
  select student;

... or in Java:

List<Student> students = database.query<Student>(new Predicate<Student>() {
  public boolean match(Student student) {
    return student.getAge() < 20 && student.getGrade().equals(gradeA);
  }
});

As you can see, Native Queries eliminate all strings from queries – they are 100% type-safe, 100% refactorable, and 100% object-oriented.

The same concept applies to our LINQ provider which allows you to smoothly move between Relational db and db4o, for a truly complimentary combination. db4o allows using all the constructs of Microsoft’s Language Integrated Queries (LINQ). db4o LINQ syntax is provided for .NET developers and aimed to make writing db4o code even more native and effortless.

Queries like this:

IEnumerable<Pilot> result =
  from Pilot p in container
  where p.Name.StartsWith("Michael") && p.Points > 2
  select p;

…are perfectly valid within db4o.

Another way to load objects from the database is to use the lazy transparent activation pattern. Suppose you already have the object 'c' of type Car; then you can get the pilote like this:

Pilot p = c.getPilot();

…all Pilote attribute are by db4o as you need them.

Resources:

380 questions
52
votes
6 answers

What is the difference between graph-based databases and object-oriented databases?

What is the difference between graph-based databases (http://neo4j.org/) and object-oriented databases (http://www.db4o.com/)?
Gili
  • 86,244
  • 97
  • 390
  • 689
32
votes
4 answers

db4o experiences?

I'm currently trying out db4o (the java version) and I pretty much like what I see. But I cannot help wondering how it does perform in a real live (web-)environment. Does anyone have any experiences (good or bad) to share about running db4o?
mafro
  • 865
  • 1
  • 10
  • 11
18
votes
3 answers

How to disable Java security manager?

Is there any way to completely disable Java security manager? I'm experimenting with source code of db4o. It uses reflection to persist objects and it seems that security manager doesn't allow reflection to read and write private or protected…
Pawel Piatkowski
  • 2,359
  • 3
  • 15
  • 8
18
votes
3 answers

A few questions about working with db4o

I am trying the db4o object databse and so far I quite like what I am seeing, but I also read this post on stackoverflow db4o experiences? indicating that not everything that seems so easy is easy. Right now, I have some questions regarding on how…
Max
  • 15,693
  • 14
  • 81
  • 131
16
votes
7 answers

Has anyone used an object database with a large amount of data?

Object databases like MongoDB and db4o are getting lots of publicity lately. Everyone that plays with them seems to love it. I'm guessing that they are dealing with about 640K of data in their sample apps. Has anyone tried to use an object…
Jon Kruger
  • 4,009
  • 4
  • 33
  • 46
15
votes
6 answers

How to design many-to-many relationships in an object database?

I thought it was about time to have a look at OO databases and decided to use db4o for my next little project - a small library. Consider the following objects: Book, Category. A Book can be in 0-n categories and a Category can be applied to 0-m…
paul
  • 13,312
  • 23
  • 81
  • 144
14
votes
3 answers

Recommend a good db4o viewer

I'm playing around with db4o, and I have the Object Manager viewer thingy for Visual Studio. It seems okay, but not exactly on par with tools like HeidiSQL/SQL Studio/etc., not to mention that it locks the db4o file--I can't use my db4o app and…
Matthew Groves
  • 25,181
  • 9
  • 71
  • 121
13
votes
5 answers

Best practice for adding a bidirectional relation in OO model

I'm struggling to come up with a good way of adding a bidirectional relation in OO model. Let's say there is a Customer who can place many Orders, that is to say there is a one-to-many association between Customer and Order classes that need to be…
Steve Furrow
  • 131
  • 1
  • 3
12
votes
4 answers

Why is EF4 Code First so slow when storing objects?

I'm currently doing some research on usage of db4o a storage for my web application. I'm quite happy how easy db4o works. So when I read about the Code First approach I kinda liked is, because the way of working with EF4 Code First is quite similar…
Saab
  • 981
  • 3
  • 11
  • 34
12
votes
4 answers

Real World Experience of db4o and/or Eloquera Database

I am evaluating two object databases, db4o (http://www.db4o.com) and Eloquera Database (http://eloquera.com) for a coming project. I have to choose one. My basic requirement is scalability, multi user support and easy type evolution for…
Ying
  • 526
  • 4
  • 16
10
votes
11 answers

Can anyone think of some good reasons *not* to use an Object-Oriented DBMS to back a website?

Say you're coding some kind of web application. Something where people can contribute content, e.g. a simple photo-sharing site. How many good reasons can you think of to not go with an object-oriented database (e.g. db4o)?
Jonathan
  • 32,202
  • 38
  • 137
  • 208
9
votes
2 answers

db4o best practice to query objects from db

I am using two different ways to query objects in db4o and I would like to discuss about it. 1) In this first example, I create an instance of ObjectContainer, I open the connection, and then I close it. ObjectContainer db =…
jcdmb
  • 3,016
  • 5
  • 38
  • 53
8
votes
2 answers

Handling data maintenance in Object Databases like db4o

One thing I have continually found very confusing about using an object database like db4o is how you are supposed to handle complex migrations that would normally be handled by SQL/PL-SQL. For example imagine you had a table in a relational…
benstpierre
  • 32,833
  • 51
  • 177
  • 288
8
votes
1 answer

db4o client/server appears to only be able to process one query at a time?

We're evaluating db4o (an OO-DBMS from http://www.db4o.com). We've put together a performance test for client/server mode, where we spin up a server, then hammer it with several clients at once. It seems like the server can only process one…
Peter Mounce
  • 4,105
  • 3
  • 34
  • 65
7
votes
6 answers

Reporting with db4o

I've used db4o with much success on many projects in the past. Over time it seems to have evolved greatly, and with modern trends like LINQ on everyone's tongue it has peaked my interest again, especially now that I know that it is starting to…
TheXenocide
  • 1,060
  • 8
  • 22
1
2 3
25 26