Lines Matching refs:txn

740 static int checkTxnObj(PyObject* txnobj, DB_TXN** txn)  in checkTxnObj()  argument
743 *txn = NULL; in checkTxnObj()
747 *txn = ((DBTxnObject*)txnobj)->txn; in checkTxnObj()
758 static int _DB_delete(DBObject* self, DB_TXN *txn, DBT *key, int flags) in _DB_delete() argument
763 err = self->db->del(self->db, txn, key, 0); in _DB_delete()
774 static int _DB_put(DBObject* self, DB_TXN *txn, DBT *key, DBT *data, int flags) in _DB_put() argument
779 err = self->db->put(self->db, txn, key, data, flags); in _DB_put()
930 self->txn=NULL; in newDBObject()
1002 newDBCursorObject(DBC* dbc, DBTxnObject *txn, DBObject* db) in newDBCursorObject() argument
1012 if (txn && ((PyObject *)txn!=Py_None)) { in newDBCursorObject()
1013 INSERT_IN_DOUBLE_LINKED_LIST_TXN(txn->children_cursors,self); in newDBCursorObject()
1014 self->txn=txn; in newDBCursorObject()
1016 self->txn=NULL; in newDBCursorObject()
1172 newDBTxnObject(DBEnvObject* myenv, DBTxnObject *parent, DB_TXN *txn, int flags) in newDBTxnObject() argument
1190 self->txn = NULL; in newDBTxnObject()
1193 parent_txn = parent->txn; in newDBTxnObject()
1196 if (txn) { in newDBTxnObject()
1197 self->txn = txn; in newDBTxnObject()
1200 err = myenv->db_env->txn_begin(myenv->db_env, parent_txn, &(self->txn), flags); in newDBTxnObject()
1235 if (self->txn) { in DBTxn_dealloc()
1322 self->txn = NULL; in newDBSequenceObject()
1425 DB_TXN *txn = NULL; in DB_append() local
1443 if (!checkTxnObj(txnobj, &txn)) return NULL; in DB_append()
1445 if (-1 == _DB_put(self, txn, &key, &data, DB_APPEND)) in DB_append()
1600 DB_TXN *txn = NULL; in DB_associate() local
1610 if (!checkTxnObj(txnobj, &txn)) return NULL; in DB_associate()
1646 txn, in DB_associate()
1672 if (self->txn) { in DB_close_internal()
1674 self->txn=NULL; in DB_close_internal()
1723 DB_TXN *txn = NULL; in _DB_consume() local
1739 if (!checkTxnObj(txnobj, &txn)) in _DB_consume()
1751 err = self->db->get(self->db, txn, &key, &data, flags|consume_flag); in _DB_consume()
1790 DB_TXN *txn = NULL; in DB_cursor() local
1797 if (!checkTxnObj(txnobj, &txn)) in DB_cursor()
1801 err = self->db->cursor(self->db, txn, &dbc, flags); in DB_cursor()
1815 DB_TXN *txn = NULL; in DB_delete() local
1824 if (!checkTxnObj(txnobj, &txn)) { in DB_delete()
1829 if (-1 == _DB_delete(self, txn, &key, 0)) { in DB_delete()
1851 DB_TXN *txn = NULL; in DB_compact() local
1869 if (!checkTxnObj(txnobj, &txn)) { in DB_compact()
1881 err = self->db->compact(self->db, txn, start_p, stop_p, &c_data, in DB_compact()
1920 DB_TXN *txn; in DB_exists() local
1931 if (!checkTxnObj(txnobj, &txn)) { in DB_exists()
1937 err = self->db->exists(self->db, txn, &key, flags); in DB_exists()
1972 DB_TXN *txn = NULL; in DB_get() local
1984 if (!checkTxnObj(txnobj, &txn)) { in DB_get()
2000 err = self->db->get(self->db, txn, &key, &data, flags); in DB_get()
2038 DB_TXN *txn = NULL; in DB_pget() local
2050 if (!checkTxnObj(txnobj, &txn)) { in DB_pget()
2069 err = self->db->pget(self->db, txn, &key, &pkey, &data, flags); in DB_pget()
2130 DB_TXN *txn = NULL; in DB_get_size() local
2139 if (!checkTxnObj(txnobj, &txn)) { in DB_get_size()
2150 err = self->db->get(self->db, txn, &key, &data, flags); in DB_get_size()
2174 DB_TXN *txn = NULL; in DB_get_both() local
2185 !checkTxnObj(txnobj, &txn) ) in DB_get_both()
2201 err = self->db->get(self->db, txn, &key, &data, flags); in DB_get_both()
2329 DB_TXN *txn = NULL; in DB_key_range() local
2340 if (!checkTxnObj(txnobj, &txn)) in DB_key_range()
2344 err = self->db->key_range(self->db, txn, &key, &range, flags); in DB_key_range()
2359 DB_TXN *txn = NULL; in DB_open() local
2381 if (!checkTxnObj(txnobj, &txn)) return NULL; in DB_open()
2393 if (txn) { /* Can't use 'txnobj' because could be 'txnobj==Py_None' */ in DB_open()
2395 self->txn=(DBTxnObject *)txnobj; in DB_open()
2397 self->txn=NULL; in DB_open()
2401 err = self->db->open(self->db, txn, filename, dbname, type, flags, mode); in DB_open()
2429 DB_TXN *txn = NULL; in DB_put() local
2442 !checkTxnObj(txnobj, &txn) ) in DB_put()
2448 if (-1 == _DB_put(self, txn, &key, &data, flags)) { in DB_put()
3266 DB_TXN *txn = NULL; in DB_stat() local
3272 if (!checkTxnObj(txnobj, &txn)) in DB_stat()
3277 err = self->db->stat(self->db, txn, &sp, flags); in DB_stat()
3417 DB_TXN *txn = NULL; in DB_truncate() local
3424 if (!checkTxnObj(txnobj, &txn)) in DB_truncate()
3428 err = self->db->truncate(self->db, txn, &count, flags); in DB_truncate()
3678 DB_TXN *txn = NULL; in _DB_has_key() local
3683 if (!checkTxnObj(txnobj, &txn)) { in _DB_has_key()
3699 err = self->db->get(self->db, txn, &key, &data, 0); in _DB_has_key()
3704 err = self->db->exists(self->db, txn, &key, 0); in _DB_has_key()
3765 _DB_make_list(DBObject* self, DB_TXN* txn, int type) in _DB_make_list() argument
3788 err = self->db->cursor(self->db, txn, &cursor, 0); in _DB_make_list()
3874 DB_TXN *txn = NULL; in DB_keys() local
3878 if (!checkTxnObj(txnobj, &txn)) in DB_keys()
3880 return _DB_make_list(self, txn, _KEYS_LIST); in DB_keys()
3888 DB_TXN *txn = NULL; in DB_items() local
3892 if (!checkTxnObj(txnobj, &txn)) in DB_items()
3894 return _DB_make_list(self, txn, _ITEMS_LIST); in DB_items()
3902 DB_TXN *txn = NULL; in DB_values() local
3906 if (!checkTxnObj(txnobj, &txn)) in DB_values()
3908 return _DB_make_list(self, txn, _VALUES_LIST); in DB_values()
4162 if (self->txn) { in DBC_close_internal()
4164 self->txn=NULL; in DBC_close_internal()
4246 return (PyObject*) newDBCursorObject(dbc, self->txn, self->mydb); in DBC_dup()
5193 DB_TXN *txn = NULL; in DBEnv_dbremove() local
5201 if (!checkTxnObj(txnobj, &txn)) { in DBEnv_dbremove()
5206 err = self->db_env->dbremove(self->db_env, txn, file, database, flags); in DBEnv_dbremove()
5221 DB_TXN *txn = NULL; in DBEnv_dbrename() local
5229 if (!checkTxnObj(txnobj, &txn)) { in DBEnv_dbrename()
5234 err = self->db_env->dbrename(self->db_env, txn, file, database, newname, in DBEnv_dbrename()
6138 DBTxnObject *txn; in DBEnv_txn_recover() local
6171 txn=newDBTxnObject(self, NULL, preplist[i].txn, 0); in DBEnv_txn_recover()
6172 if (!txn) { in DBEnv_txn_recover()
6177 txn->flag_prepare=1; /* Recover state */ in DBEnv_txn_recover()
6182 Py_DECREF(txn); in DBEnv_txn_recover()
6188 Py_DECREF(txn); in DBEnv_txn_recover()
6192 if (PyTuple_SetItem(tuple, 1, (PyObject *)txn)) { in DBEnv_txn_recover()
6194 Py_DECREF(txn); in DBEnv_txn_recover()
6214 DB_TXN *txn = NULL; in DBEnv_txn_begin() local
6221 if (!checkTxnObj(txnobj, &txn)) in DBEnv_txn_begin()
6728 DB_TXN *txn = NULL; in DBEnv_log_printf() local
6737 if (!checkTxnObj(txnobj, &txn)) in DBEnv_log_printf()
6744 err = self->db_env->log_printf(self->db_env, txn, "%s", string); in DBEnv_log_printf()
8093 static void _close_transaction_cursors(DBTxnObject* txn) in _close_transaction_cursors() argument
8097 while(txn->children_cursors) { in _close_transaction_cursors()
8100 dummy=DBC_close_internal(txn->children_cursors); in _close_transaction_cursors()
8105 static void _promote_transaction_dbs_and_sequences(DBTxnObject *txn) in _promote_transaction_dbs_and_sequences() argument
8110 while (txn->children_dbs) { in _promote_transaction_dbs_and_sequences()
8111 db=txn->children_dbs; in _promote_transaction_dbs_and_sequences()
8113 if (txn->parent_txn) { in _promote_transaction_dbs_and_sequences()
8114 INSERT_IN_DOUBLE_LINKED_LIST_TXN(txn->parent_txn->children_dbs,db); in _promote_transaction_dbs_and_sequences()
8115 db->txn=txn->parent_txn; in _promote_transaction_dbs_and_sequences()
8120 db->txn=NULL; in _promote_transaction_dbs_and_sequences()
8124 while (txn->children_sequences) { in _promote_transaction_dbs_and_sequences()
8125 dbs=txn->children_sequences; in _promote_transaction_dbs_and_sequences()
8127 if (txn->parent_txn) { in _promote_transaction_dbs_and_sequences()
8128 INSERT_IN_DOUBLE_LINKED_LIST_TXN(txn->parent_txn->children_sequences,dbs); in _promote_transaction_dbs_and_sequences()
8129 dbs->txn=txn->parent_txn; in _promote_transaction_dbs_and_sequences()
8134 dbs->txn=NULL; in _promote_transaction_dbs_and_sequences()
8144 DB_TXN *txn; in DBTxn_commit() local
8151 if (!self->txn) { in DBTxn_commit()
8162 txn = self->txn; in DBTxn_commit()
8163 self->txn = NULL; /* this DB_TXN is no longer valid after this call */ in DBTxn_commit()
8168 err = txn->commit(txn, flags); in DBTxn_commit()
8193 if (!self->txn) { in DBTxn_prepare()
8205 err = self->txn->prepare(self->txn, (u_int8_t*)gid); in DBTxn_prepare()
8217 DB_TXN *txn; in DBTxn_abort_discard_internal() local
8219 if (!self->txn) { in DBTxn_abort_discard_internal()
8229 txn = self->txn; in DBTxn_abort_discard_internal()
8230 self->txn = NULL; /* this DB_TXN is no longer valid after this call */ in DBTxn_abort_discard_internal()
8247 err = txn->discard(txn,0); in DBTxn_abort_discard_internal()
8254 err = txn->abort(txn); in DBTxn_abort_discard_internal()
8286 if (!self->txn) { in DBTxn_id()
8297 id = self->txn->id(self->txn); in DBTxn_id()
8317 err = self->txn->set_timeout(self->txn, (db_timeout_t)timeout, flags); in DBTxn_set_timeout()
8336 err = self->txn->set_name(self->txn, name); in DBTxn_set_name()
8353 err = self->txn->get_name(self->txn, &name); in DBTxn_get_name()
8383 if (self->txn) { in DBSequence_close_internal()
8385 self->txn=NULL; in DBSequence_close_internal()
8426 DB_TXN *txn = NULL; in DBSequence_get() local
8432 if (!checkTxnObj(txnobj, &txn)) in DBSequence_get()
8436 err = self->sequence->get(self->sequence, txn, delta, &value, flags); in DBSequence_get()
8499 DB_TXN *txn = NULL; in DBSequence_open() local
8506 if (!checkTxnObj(txnobj, &txn)) in DBSequence_open()
8513 err = self->sequence->open(self->sequence, txn, &key, flags); in DBSequence_open()
8519 if (txn) { in DBSequence_open()
8521 self->txn=(DBTxnObject *)txnobj; in DBSequence_open()
8533 DB_TXN *txn = NULL; in DBSequence_remove() local
8539 if (!checkTxnObj(txnobj, &txn)) in DBSequence_remove()
8545 err = self->sequence->remove(self->sequence, txn, flags); in DBSequence_remove()