Forum Stats

  • 3,840,131 Users
  • 2,262,570 Discussions
  • 7,901,154 Comments

Discussions

does anybody has the code for developping multi-process program .thank you.

529558
529558 Member Posts: 8
edited Aug 30, 2006 8:32AM in Berkeley DB
I want to run two instance of the same program ,the motive is to access the same data-base at the same time.
I set the database evironment with the flag of DB_INIT_TXN | DB_RECOVER | DB_INIT_LOCK,but the one instance
can't see the modification as the other one has modified the database .

Comments

  • 529558
    529558 Member Posts: 8
    problem has been solved .
    improper flag for DbEnv::Open() is the ring-leader :

    newly set flag :
    #define DEFAULT_EVIRONMENT (DB_CREATE | DB_INIT_LOG | DB_INIT_MPOOL | DB_THREAD | DB_REGISTER)

    former flag :
    #define DEFAULT_EVIRONMENT (DB_CREATE | DB_INIT_LOG | DB_INIT_MPOOL | DB_THREAD | DB_PRIVATE)
  • 512799
    512799 Member Posts: 494
    There is a sample multi-threaded (not multi-process) application that is built into each of the Transaction Guides that you may find useful.

    For example:

    http://www.sleepycat.com/docs/gsg_txn/CXX/txnexample_c.html

    Ron
This discussion has been closed.