Skip to content

Commit

Permalink
lmdb 0.9.16 - previous rebase was incorrect
Browse files Browse the repository at this point in the history
  • Loading branch information
krisskross committed Aug 19, 2015
1 parent 2ff6e9d commit fee4e09
Show file tree
Hide file tree
Showing 6 changed files with 423 additions and 715 deletions.
6 changes: 3 additions & 3 deletions lmdbjni/src/main/java/org/fusesource/lmdbjni/JNI.java
Original file line number Diff line number Diff line change
Expand Up @@ -473,9 +473,9 @@ public static final native int mdb_txn_begin(
/**
* <a href="http://symas.com/mdb/doc/group__mdb.html#">details</a>
*/
@JniMethod
public static final native int mdb_txn_id(
@JniArg(cast = "MDB_txn *") long txn);
// @JniMethod
// public static final native int mdb_txn_id(
// @JniArg(cast = "MDB_txn *") long txn);

/**
* <a href="http://symas.com/mdb/doc/group__mdb.html#">details</a>
Expand Down
6 changes: 3 additions & 3 deletions lmdbjni/src/main/java/org/fusesource/lmdbjni/Transaction.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ public class Transaction extends NativeObject implements Closeable {
*
* @return A transaction ID, valid if input is an active transaction.
*/
public long getId() {
return mdb_txn_id(pointer());
}
// public long getId() {
// return mdb_txn_id(pointer());
// }

/**
* <p>
Expand Down
35 changes: 6 additions & 29 deletions lmdbjni/src/main/native-package/src/lmdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,11 @@
* stale locks can block further operation.
*
* Fix: Check for stale readers periodically, using the
* #mdb_reader_check function or the \ref mdb_stat_1 "mdb_stat" tool.
* Stale writers will be cleared automatically on most systems:
* - Windows - automatic
* - BSD, systems using SysV semaphores - automatic
* - Linux, systems using POSIX mutexes with Robust option - automatic
* Otherwise just make all programs using the database close it;
* the lockfile is always reset on first open of the environment.
* #mdb_reader_check function or the \ref mdb_stat_1 "mdb_stat" tool. Or just
* make all programs using the database close it; the lockfile
* is always reset on first open of the environment.
*
* - On BSD systems or others configured with MDB_USE_SYSV_SEM or
* MDB_USE_POSIX_SEM,
* - On BSD systems or others configured with MDB_USE_POSIX_SEM,
* startup can fail due to semaphores owned by another userid.
*
* Fix: Open and close the database as the user which owns the
Expand Down Expand Up @@ -111,9 +106,6 @@
* for stale readers is performed or the lockfile is reset,
* since the process may not remove it from the lockfile.
*
* This does not apply to write transactions if the system clears
* stale writers, see above.
*
* - If you do that anyway, do a periodic check for stale readers. Or
* close the environment once in a while, so the lockfile can get reset.
*
Expand Down Expand Up @@ -399,7 +391,7 @@ typedef enum MDB_cursor_op {
#define MDB_PAGE_NOTFOUND (-30797)
/** Located page was wrong type */
#define MDB_CORRUPTED (-30796)
/** Update of meta page failed or environment had fatal error */
/** Update of meta page failed, probably I/O error */
#define MDB_PANIC (-30795)
/** Environment version mismatch */
#define MDB_VERSION_MISMATCH (-30794)
Expand Down Expand Up @@ -432,7 +424,7 @@ typedef enum MDB_cursor_op {
#define MDB_INCOMPATIBLE (-30784)
/** Invalid reuse of reader locktable slot */
#define MDB_BAD_RSLOT (-30783)
/** Transaction must abort, has a child, or is invalid */
/** Transaction cannot recover - it must be aborted */
#define MDB_BAD_TXN (-30782)
/** Unsupported size of key/DB name/data, or wrong DUPFIXED size */
#define MDB_BAD_VALSIZE (-30781)
Expand Down Expand Up @@ -938,10 +930,6 @@ int mdb_env_set_assert(MDB_env *env, MDB_assert_func *func);
* <ul>
* <li>#MDB_RDONLY
* This transaction will not perform any write operations.
* <li>#MDB_NOSYNC
* Don't flush system buffers to disk when committing this transaction.
* <li>#MDB_NOMETASYNC
* Flush system buffers but omit metadata flush when committing this transaction.
* </ul>
* @param[out] txn Address where the new #MDB_txn handle will be stored
* @return A non-zero error value on failure and 0 on success. Some possible
Expand All @@ -965,17 +953,6 @@ int mdb_txn_begin(MDB_env *env, MDB_txn *parent, unsigned int flags, MDB_txn **
*/
MDB_env *mdb_txn_env(MDB_txn *txn);

/** @brief Return the transaction's ID.
*
* This returns the identifier associated with this transaction. For a
* read-only transaction, this corresponds to the snapshot being read;
* concurrent readers will frequently have the same transaction ID.
*
* @param[in] txn A transaction handle returned by #mdb_txn_begin()
* @return A transaction ID, valid if input is an active transaction.
*/
size_t mdb_txn_id(MDB_txn *txn);

/** @brief Commit all the operations of a transaction into the database.
*
* The transaction handle is freed. It and its cursors must not be used
Expand Down
Loading

0 comments on commit fee4e09

Please sign in to comment.