EINVAL error for DB->open

EINVAL error for DB->open

Post by mozar » Sun, 05 Feb 2006 07:28:27



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

 
 
 

EINVAL error for DB->open

Post by bos.. » Fri, 10 Feb 2006 04:05:54



> 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

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

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

 
 
 

1. multiple databases: DB->open EINVAL error

Hello,

I tried to create a single file containing many databases.
Creating environnement then handle works well but opening the
database gives me an EINVAL error.

The documentation say that I must set up many things:

-locking
-pool
-page size
-encryption and checksum
-byte order
etc...

Could you tell me how to setu up the environnement and what
customizations
are realy required to build multiple database in a single files.

Thank you

------------------
OS: Linux slackware

2. Synchronizing Internet Password & Notes Password

3. Handling disk out of space errors in db->open

4. MMC Snapins for w2k and w2k3

5. Error >>syntax error<< at >>$1<< at character 53

6. Psion 5 v. Psion 5 screens

7. Sample Code for db->getbyteswapped and db->set_lorder

8. SMS with Cisco VLANs broadcast limitations / discovery

9. db->put internally calling db->pget ?

10. >>>> Job Opening S/W Tester - Recruiter

11. >>>> Job Opening S/W Testing QA/QC - Recruiter

12. db->open blocked by pending deadlock

13. db->open problem in Tornado2.2