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.