diff options
author | jbj <devnull@localhost> | 2004-11-11 15:58:46 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2004-11-11 15:58:46 +0000 |
commit | acf19af1ab27ad071c1614f9610ae29eb5c902c1 (patch) | |
tree | eec4be5e0c491d0171d25c17eaa136ce62a90417 /db/rpc_server | |
parent | f9473219d523ace837a3ef5a1212bb6dcad2a690 (diff) | |
download | librpm-tizen-acf19af1ab27ad071c1614f9610ae29eb5c902c1.tar.gz librpm-tizen-acf19af1ab27ad071c1614f9610ae29eb5c902c1.tar.bz2 librpm-tizen-acf19af1ab27ad071c1614f9610ae29eb5c902c1.zip |
Upgrade to db-4.3.21.
CVS patchset: 7578
CVS date: 2004/11/11 15:58:46
Diffstat (limited to 'db/rpc_server')
-rw-r--r-- | db/rpc_server/java/RpcDb.java | 12 | ||||
-rw-r--r-- | db/rpc_server/java/RpcDbc.java | 6 | ||||
-rw-r--r-- | db/rpc_server/java/Util.java | 10 |
3 files changed, 16 insertions, 12 deletions
diff --git a/db/rpc_server/java/RpcDb.java b/db/rpc_server/java/RpcDb.java index 9a16b5332..bcdb861e3 100644 --- a/db/rpc_server/java/RpcDb.java +++ b/db/rpc_server/java/RpcDb.java @@ -4,7 +4,7 @@ * Copyright (c) 2001-2004 * Sleepycat Software. All rights reserved. * - * $Id: RpcDb.java,v 1.23 2004/09/24 15:27:47 mjc Exp $ + * $Id: RpcDb.java,v 1.24 2004/11/05 00:42:40 mjc Exp $ */ package com.sleepycat.db.rpcserver; @@ -73,7 +73,7 @@ public class RpcDb extends Timer { } } - public void close(Dispatcher server, + public void close(Dispatcher server, __db_close_msg args, __db_close_reply reply) { if (refcount == 0 || --refcount > 0) { reply.status = 0; @@ -83,7 +83,7 @@ public class RpcDb extends Timer { try { server.delDatabase(this, false); if (db != null) - db.close(args.flags != DbConstants.DB_NOSYNC); + db.close((args.flags & DbConstants.DB_NOSYNC) != 0); reply.status = 0; } catch (Throwable t) { reply.status = Util.handleException(t); @@ -273,7 +273,7 @@ public class RpcDb extends Timer { reply.lorder = rdb.config.getByteOrder(); reply.status = 0; - Server.err.println("Sharing Database: " + reply.dbcl_id); + // Server.err.println("Sharing Database: " + reply.dbcl_id); } return matchFound; @@ -313,14 +313,16 @@ public class RpcDb extends Timer { RpcDbTxn rtxn = server.getTxn(args.txnpcl_id); Transaction txn = (rtxn != null) ? rtxn.txn : null; - Server.err.println("Calling db.open(" + null + ", " + dbname + ", " + subdbname + ", " + args.type + ", " + Integer.toHexString(args.flags) + ", " + args.mode + ")"); + // Server.err.println("Calling db.open(" + null + ", " + dbname + ", " + subdbname + ", " + args.type + ", " + Integer.toHexString(args.flags) + ", " + args.mode + ")"); config.setAllowCreate((args.flags & DbConstants.DB_CREATE) != 0); config.setExclusiveCreate((args.flags & DbConstants.DB_EXCL) != 0); config.setReadOnly((args.flags & DbConstants.DB_RDONLY) != 0); config.setTransactional(txn != null || (args.flags & DbConstants.DB_AUTO_COMMIT) != 0); + config.setTruncate((args.flags & DbConstants.DB_TRUNCATE) != 0); config.setType(Util.toDatabaseType(args.type)); config.setMode(args.mode); + db = rdbenv.dbenv.openDatabase(txn, dbname, subdbname, config); ++refcount; diff --git a/db/rpc_server/java/RpcDbc.java b/db/rpc_server/java/RpcDbc.java index c0d882276..75f644c4b 100644 --- a/db/rpc_server/java/RpcDbc.java +++ b/db/rpc_server/java/RpcDbc.java @@ -4,7 +4,7 @@ * Copyright (c) 2001-2004 * Sleepycat Software. All rights reserved. * - * $Id: RpcDbc.java,v 1.12 2004/04/09 15:08:40 mjc Exp $ + * $Id: RpcDbc.java,v 1.13 2004/11/05 01:08:31 mjc Exp $ */ package com.sleepycat.db.rpcserver; @@ -277,11 +277,11 @@ public class RpcDbc extends Timer { break; case DbConstants.DB_AFTER: - status = dbc.putAfter(data); + status = dbc.putAfter(key, data); break; case DbConstants.DB_BEFORE: - status = dbc.putBefore(data); + status = dbc.putBefore(key, data); break; case DbConstants.DB_NOOVERWRITE: diff --git a/db/rpc_server/java/Util.java b/db/rpc_server/java/Util.java index fedb4c73f..cd7797fa7 100644 --- a/db/rpc_server/java/Util.java +++ b/db/rpc_server/java/Util.java @@ -4,7 +4,7 @@ * Copyright (c) 2001-2004 * Sleepycat Software. All rights reserved. * - * $Id: Util.java,v 1.5 2004/09/23 23:56:43 bostic Exp $ + * $Id: Util.java,v 1.6 2004/11/05 00:42:41 mjc Exp $ */ package com.sleepycat.db.rpcserver; @@ -15,15 +15,17 @@ import com.sleepycat.db.*; import com.sleepycat.db.internal.DbConstants; /** - * Helper methods for JDB <-> DB mapping + * Helper methods for Java API <-> C API mapping */ public class Util { static int handleException(Throwable t) { int ret = Server.EINVAL; - if (t instanceof DatabaseException) + if (t instanceof DatabaseException) { ret = ((DatabaseException)t).getErrno(); - else if (t instanceof FileNotFoundException) + if (ret == DbConstants.DB_LOCK_NOTGRANTED) + ret = DbConstants.DB_LOCK_DEADLOCK; + } else if (t instanceof FileNotFoundException) ret = Server.ENOENT; t.printStackTrace(Server.err); |