users@glassfish.java.net

Re: Berkeley DB and Glassfish

From: <glassfish_at_javadesktop.org>
Date: Fri, 18 Jan 2008 10:20:06 PST

This would be new ground I think.

The primary problem (from an overall JEE point of view) is that JEE is dominantly used with relational databases, specifically through JDBC. And JDBC doesn't work at all with BDB (it's not a relational DB, or, more specifically, it doesn't support SQL).

So, right off the bat, the JPA and EJB entities are right out (actually, to be fair, you could probably use classic EJB entity beans, but they couldn't be Container Managed Persistence).

The real integration point that you want (at least, that I would want), is to get the BDB integrated with the underlying JEE transaction mechanism. This is assuming that you're using BDB transactions. If you're not, then it simply becomes a utility library that you call when you like.

Are you embedding BDB or talking to a BDB server? If the former, then it's even more straightforward (I think, I have no direct BDB experience) to integrate it at the jar level. If the latter, and you want to have some kind of data connection pooling, you will most likely have to create your own connection pool and a resource wrapper to inject that pool in to the JNDI of the server. (There are several connection pool frameworks available on the web you could leverage.)

JEE has mechanisms to allow you to get the integration you want. In theory all of the components within JEE are integrated through these mechanisms, and they're exposed for your use.

But it's not a common use case. Hopefully someone from the team will have a better idea on how you might be able to integrate BDB to be a better first class citizen within an EJB container.

It would help to tell us what kind of integration you were looking for.
[Message sent by forum member 'whartung' (whartung)]

http://forums.java.net/jive/thread.jspa?messageID=254741