« Experiences Tuning Berkeley DB Java Edition (Repost from 10/24/05 on Sleepycat blog) | Main | Berkeley DB Java Edition 3.1.0 Available »

JE JCA: JEConnection.removeDatabase and truncateDatabase

The Berkeley Java Edition (JE) Java Connection Architecture (JCA) Resource Adapter (RA) provides  openDatabase() and openSecondaryDatabase() methods.  These methods are backed by a set of Database handle caches and are provided in the JEConnection API so that each connection to JE within the J2EE environment does not have to incur the cost of opening a database.  Instead, if the DatabaseConfig matches an entry in the cache, that entry is returned.

Recently, a user noted that there was no way to delete a database using the JE Resource Adapter because Database.removeDatabase() and Database.truncateDatabase() both require the underlying handle to be closed first.  With the JEConnection cache of handles, it is not possible to force closure of all handles in the cache (nor clearing the cache).  For JE 3.1.0, we have added JEConnection.removeDatabase() and JEConnection.truncateDatabase().  These methods first clear the cache (closing each Database in the process) and then perform the underlying delete/truncate operation.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About This Entry

This page contains a single entry from the blog posted on September 24, 2006 1:38 PM.

The previous post in this blog was Experiences Tuning Berkeley DB Java Edition (Repost from 10/24/05 on Sleepycat blog).

The next post in this blog is Berkeley DB Java Edition 3.1.0 Available.

Many more can be found on the main index page or by looking through the archives.

Top Tags

Powered by
Movable Type and Oracle