dbTalk Databases Forums  

EINVAL error for DB->open

comp.databases.berkeley-db comp.databases.berkeley-db


Discuss EINVAL error for DB->open in the comp.databases.berkeley-db forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
mozart
 
Posts: n/a

Default EINVAL error for DB->open - 02-03-2006 , 04:28 PM






Hi
I have a very simple application that has been working well with bdb
version 4.0 (on Redhat Linux 9).

I am migrating this application to FC4 (linux). I have dbd version 4.3
here.

As I migrated, I earlier got comilation error on DB->open(). Looks like
an extra (transid)
argument has been added to DB-open() in newer bdb version. After
adding the extra arg (second), it fails now with EINVAL error.

My code is -

extern u_int32_t hash_function(DB* hash_table, const void *data,
u_int32_t data_size) ;
DB * var_hash_table;

if (db_create(&var_hash_table, NULL, 0)) {
printf("Error in init_userinfo(): Failed in creating the variable
hash table\n");
return (FAILURE);
}

if (var_hash_table->set_h_hash(var_hash_table, hash_function)) {
printf("Error in init_userinfo(): Failed in setting the hash
function for the variable hash table\n");
return (FAILURE);
}

//if (var_hash_table->open(var_hash_table, NULL, NULL, DB_HASH, 0,
0)) new version extra second arg - txnid
if ((ret = var_hash_table->open(var_hash_table, NULL, NULL, NULL,
DB_HASH, 0, 0)))
{
printf("Error in init_userinfo(): Failed in opening the variable
hash table ret=%d \n", ret));
return (FAILURE);
}


Anybody has any idea, What's wrong here?

Thanks
--Anil


Reply With Quote
  #2  
Old   
bostic@sleepycat.com
 
Posts: n/a

Default Re: EINVAL error for DB->open - 02-08-2006 , 01:05 PM







mozart wrote:
Quote:
I am migrating this application to FC4 (linux). I have dbd version 4.3
here.

As I migrated, I earlier got comilation error on DB->open(). Looks like
an extra (transid)
argument has been added to DB-open() in newer bdb version. After
adding the extra arg (second), it fails now with EINVAL error.
The additional transactional argument was added to the Db.open method
in the Berkeley DB 4.1 release. For details, please see:

http://www.sleepycat.com/docs/ref/upgrade.4.1/fop.html

There are specific upgrade instructions for each Berkeley DB release,
and
I would suggest reviewing them for the releases between 4.0 and 4.3.
For
more information, please see Chapter 28 of the Berkeley DB Reference
Guide, included in your download package and also available at:

http://www.sleepycat.com/docs/ref/toc.html

Finally, the Berkeley DB library optionally outputs a verbose error
message whenever it is about to return a general-purpose error,
or throw a non-specific exception. Whenever it is not clear why
an application call into Berkeley DB is failing, the first step
is always to turn on verbose error messages, which will almost
always explain the problem. For more information on turning on
verbose error messages, please see the "Run-time error
information" section of the Berkeley DB Reference Guide,
included in your download package and also available at:

http://www.sleepycat.com/docs/ref/debug/runtime.html

Regards,
--keith

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Keith Bostic bostic (AT) sleepycat (DOT) com
Sleepycat Software Inc. keithbosticim (Yahoo IM)
118 Tower Rd. +1-781-259-3139
Lincoln, MA 01773 http://www.sleepycat.com



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.