niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Databases » Berkeley DB
RPC server secondary indices problem
Post new topic   Reply to topic Page 1 of 1 [1 Post] View previous topic :: View next topic
Author Message
pradeepa
*nix forums beginner


Joined: 07 Apr 2005
Posts: 3

PostPosted: Mon Apr 11, 2005 12:02 pm    Post subject: RPC server secondary indices problem Reply with quote

In the application, it creates serveral indices for each bdb file.
and application uses RPC.

As documentation says, " Although a client cannot specify a callback,
Berkeley DB does support the DB->associate call in a limited manner. A
client program wishing to use a secondary index may do so only in a
read-only fashion. The primary and secondary databases must have been
created locally on the server machine. Client programs must then open
both the primary and secondary databases with the DB_RDONLY flag set.
The client must also specify a NULL callback for the DB->associate
call." , I set my codes.
When creating db in rpc server locally, at the RPC server, addition to
db open functions, set_bt_compare function also called.

but it gives errors "Inavlid argument" for DB->cursor and DBcursor->get
methods.

env open flags are DB_CREATE | DB_INIT_LOG | DB_INIT_LOCK |
DB_INIT_MPOOL | DB_INIT_TXN | DB_RECOVER

at the rpc server, db open flags are DB_CREATE | DB_AUTO_COMMIT |
DB_THREAD

............ at the rpc server db open

if ((ret =
(dbh->tbl_name##_##indx_name##_indx)->open((dbh->tbl_name##_##indx_name##_indx),
NULL, \
#tbl_name"_"#indx_name"_indx.db", NULL, DB_BTREE, DB_CREATE |
DB_AUTO_COMMIT | DB_THREAD, 0644)) != 0) \

......................



..................... at the client, cursor operations
if ((ret = dbenv->txn_begin(dbenv, NULL, &tid, 0)) != 0) {
dbenv->err(dbenv, ret, "DB_ENV->txn_begin");
goto error;
}

if ((ret = db->cursor(db,
tid, &dbcp, 0)) != 0) {
db->err(db, ret, "DB->cursor");
goto error;
}
................ it always goes to error

How can I solve the problem and update database correctly?

Regards,
pradeepag
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [1 Post] View previous topic :: View next topic
The time now is Thu Jan 08, 2009 3:21 am | All times are GMT
navigation Forum index » Databases » Berkeley DB
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Unknown in header problem -SOLVED- Light Speed Postfix 0 Thu Jul 03, 2008 10:40 am
No new posts Transfer qmail email account to postfix server tallman Postfix 0 Thu Jun 05, 2008 12:43 pm
No new posts problem with sending mail nuxia Postfix 0 Mon Apr 21, 2008 3:58 am
No new posts Postfix 2.3.8 Virtual problem Blotto Postfix 0 Fri Apr 04, 2008 6:11 am
No new posts Postfix sending problem for local domain remote email monkey_magix Postfix 0 Mon Sep 10, 2007 10:17 am

Bad Credit Loans | eBay | Guitar Lessons | Debt Consolidation | Mortgage
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.2052s ][ Queries: 16 (0.1440s) ][ GZIP on - Debug on ]