« Are Your Transactions Really Durable? (Repost from 1/31/06 on Sleepycat Blog) | Main | Split Lock Table in JE 2.1 (repost from 12/15/05 on Sleepycat blog) »

Database Method Performance in JE 2.1 (repost from 12/23/05 on Sleepycat blog)

[The following is a repost of the 12/23/05 Sleepycat blog entry.]

In JE, the various Database-based operations (e.g. Database.put(), Database.get(), etc.) all are implemented by creating a Cursor object and then running the equivalent Cursor method. The internal Cursor
method implementations all start by "cloning" the cursor and then
performing the requested operation. Upon successful completion of the
operation, the cloned cursor becomes the "real" cursor that is returned
to the user program. That way, if the operation fails somewhere in the
middle of the tree, restoring the original state of the cursor is easy
(we throw away the cloned cursor and revert back to the original cursor
that was passed to us in the first place).

But the Database
operations don't need the benefit of the clone operation because the
internal cursor is never exposed to the user. Hence, if a Database operation ends up in a strange state (i.e. the operation is not going to succeed), we don't need to revert the cursor.

The next release of JE (2.1) will remove this performance penalty from the Database operations by not cloning the internal cursor.

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 22, 2006 1:35 PM.

The previous post in this blog was Are Your Transactions Really Durable? (Repost from 1/31/06 on Sleepycat Blog).

The next post in this blog is Split Lock Table in JE 2.1 (repost from 12/15/05 on Sleepycat blog).

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

Top Tags

Powered by
Movable Type and Oracle