Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How can I share a transaction between Berkeley DB and BDB XML?

0
Posted

How can I share a transaction between Berkeley DB and BDB XML?

0

The transacted methods in BDB XML all take an XmlTransaction object. This object can be constructed using an already-created Berkeley DB transaction object. Another mechanism is to get the Berkeley DB object from the BDB XML XmlTransaction object. The thing to avoid is creating two unrelated transaction objects that may conflict with one another. In C++, to construct an XmlTransaction from DbTxn: DbTxn *dbtxn = 0; // use Berkeley DB environment to begin a transaction env.txn_begin(0, &dbtxn, 0); … // create XmlTransaction from DbTxn XmlTransaction xmltxn = manager.createTransaction(dbtxn); In C++, to obtain a DbTxn from XmlTransaction: XmlTransaction xmltxn = manager.createTransaction(); // get DbTxn DbTxn *dbtxn = xmltxn.getDbTxn(); When using DbTxn and XmlTransaction together, a couple of rules are important. Once a transaction is committed or aborted, the underlying DbTxn object will have been deleted, and must not be referenced again. Also, a DbTxn object may only be referenced b

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123