… | |
… | |
27 | db_sync $db; |
27 | db_sync $db; |
28 | |
28 | |
29 | # when you also use Coro, management is easy: |
29 | # when you also use Coro, management is easy: |
30 | use Coro::BDB; |
30 | use Coro::BDB; |
31 | |
31 | |
32 | # automatic event loop intergration with AnyEvent: |
32 | # automatic event loop integration with AnyEvent: |
33 | use AnyEvent::BDB; |
33 | use AnyEvent::BDB; |
34 | |
34 | |
35 | # automatic result processing with EV: |
35 | # automatic result processing with EV: |
36 | my $WATCHER = EV::io BDB::poll_fileno, EV::READ, \&BDB::poll_cb; |
36 | my $WATCHER = EV::io BDB::poll_fileno, EV::READ, \&BDB::poll_cb; |
37 | |
37 | |
… | |
… | |
110 | use base 'Exporter'; |
110 | use base 'Exporter'; |
111 | |
111 | |
112 | our $VERSION; |
112 | our $VERSION; |
113 | |
113 | |
114 | BEGIN { |
114 | BEGIN { |
115 | $VERSION = '1.84'; |
115 | $VERSION = '1.91'; |
116 | |
116 | |
117 | our @BDB_REQ = qw( |
117 | our @BDB_REQ = qw( |
118 | db_env_open db_env_close db_env_txn_checkpoint db_env_lock_detect |
118 | db_env_open db_env_close db_env_txn_checkpoint db_env_lock_detect |
119 | db_env_memp_sync db_env_memp_trickle db_env_dbrename db_env_dbremove |
119 | db_env_memp_sync db_env_memp_trickle db_env_dbrename db_env_dbremove |
120 | db_env_log_archive |
120 | db_env_log_archive db_env_lsn_reset |
121 | db_open db_close db_compact db_sync db_verify db_upgrade |
121 | db_open db_close db_compact db_sync db_verify db_upgrade |
122 | db_put db_exists db_get db_pget db_del db_key_range |
122 | db_put db_exists db_get db_pget db_del db_key_range |
123 | db_txn_commit db_txn_abort db_txn_finish |
123 | db_txn_commit db_txn_abort db_txn_finish |
124 | db_c_close db_c_count db_c_put db_c_get db_c_pget db_c_del |
124 | db_c_close db_c_count db_c_put db_c_get db_c_pget db_c_del |
125 | db_sequence_open db_sequence_close |
125 | db_sequence_open db_sequence_close |
… | |
… | |
203 | db_env_memp_sync (DB_ENV *env, SV *dummy = 0, SV *callback = 0) |
203 | db_env_memp_sync (DB_ENV *env, SV *dummy = 0, SV *callback = 0) |
204 | db_env_memp_trickle (DB_ENV *env, int percent, SV *dummy = 0, SV *callback = 0) |
204 | db_env_memp_trickle (DB_ENV *env, int percent, SV *dummy = 0, SV *callback = 0) |
205 | db_env_dbremove (DB_ENV *env, DB_TXN_ornull *txnid, bdb_filename file, bdb_filename database, U32 flags = 0, SV *callback = 0) |
205 | db_env_dbremove (DB_ENV *env, DB_TXN_ornull *txnid, bdb_filename file, bdb_filename database, U32 flags = 0, SV *callback = 0) |
206 | db_env_dbrename (DB_ENV *env, DB_TXN_ornull *txnid, bdb_filename file, bdb_filename database, bdb_filename newname, U32 flags = 0, SV *callback = 0) |
206 | db_env_dbrename (DB_ENV *env, DB_TXN_ornull *txnid, bdb_filename file, bdb_filename database, bdb_filename newname, U32 flags = 0, SV *callback = 0) |
207 | db_env_log_archive (DB_ENV *env, SV *listp, U32 flags = 0, SV *callback = 0) |
207 | db_env_log_archive (DB_ENV *env, SV *listp, U32 flags = 0, SV *callback = 0) |
|
|
208 | db_env_lsn_reset (DB_ENV *env, bdb_filename db, U32 flags = 0, SV *callback = 0) |
208 | |
209 | |
209 | $db = db_create (DB_ENV *env = 0, U32 flags = 0) |
210 | $db = db_create (DB_ENV *env = 0, U32 flags = 0) |
210 | flags: XA_CREATE |
211 | flags: XA_CREATE |
211 | |
212 | |
212 | db_open (DB *db, DB_TXN_ornull *txnid, bdb_filename file, bdb_filename database, int type, U32 flags, int mode, SV *callback = 0) |
213 | db_open (DB *db, DB_TXN_ornull *txnid, bdb_filename file, bdb_filename database, int type, U32 flags, int mode, SV *callback = 0) |
… | |
… | |
771 | |
772 | |
772 | =head2 Unexpected Crashes |
773 | =head2 Unexpected Crashes |
773 | |
774 | |
774 | Remember that, by default, BDB will execute requests in parallel, in |
775 | Remember that, by default, BDB will execute requests in parallel, in |
775 | somewhat random order. That means that it is easy to run a C<db_get> |
776 | somewhat random order. That means that it is easy to run a C<db_get> |
776 | request on thesa me database as a concurrent C<db_close> request, leading |
777 | request on the same database as a concurrent C<db_close> request, leading |
777 | to a crash, silent data corruption, eventually the next world war on |
778 | to a crash, silent data corruption, eventually the next world war on |
778 | terrorism. |
779 | terrorism. |
779 | |
780 | |
780 | If you only ever use foreground requests (without a callback), this will |
781 | If you only ever use foreground requests (without a callback), this will |
781 | not be an issue. |
782 | not be an issue (unless you use threads). |
782 | |
783 | |
783 | =head2 Unexpected Freezes or Deadlocks |
784 | =head2 Unexpected Freezes or Deadlocks |
784 | |
785 | |
785 | Remember that, by default, BDB will execute requests in parallel, which |
786 | Remember that, by default, BDB will execute requests in parallel, which |
786 | easily leads to deadlocks (even concurrent put's on the same database can |
787 | easily leads to deadlocks (even concurrent put's on the same database can |