⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 data_open.so

📁 berkeley db 4.6.21的源码。berkeley db是一个简单的数据库管理系统
💻 SO
字号:
m4_comment([$Id: data_open.so,v 1.13 2004/04/28 13:15:29 bostic Exp $])m4_ref_title(m4_tam Applications,    Opening the databases,, transapp/env_open, transapp/put)m4_p([dnlNext, we open three databases ("color" and "fruit" and "cats"), in thedatabase environment.  Again, our m4_ref(Db) database handles aredeclared to be free-threaded using the m4_ref(DB_THREAD) flag, and somay be used by any number of threads we subsequently create.])include(ref/transapp/data_open.cs)m4_p([dnlAfter opening the database, we can use the m4_ref(db_stat) utility todisplay information about a database we have created:])m4_indent([dnlprompt__GT__ db_stat -h TXNAPP -d color53162   Btree magic number.8       Btree version number.Flags:2       Minimum keys per-page.8192    Underlying database page size.1       Number of levels in the tree.0       Number of unique keys in the tree.0       Number of data items in the tree.0       Number of tree internal pages.0       Number of bytes free in tree internal pages (0% ff).1       Number of tree leaf pages.8166    Number of bytes free in tree leaf pages (0.% ff).0       Number of tree duplicate pages.0       Number of bytes free in tree duplicate pages (0% ff).0       Number of tree overflow pages.0       Number of bytes free in tree overflow pages (0% ff).0       Number of pages on the free list.])m4_p([dnlThe database open must be enclosed within a transaction in order to berecoverable.  The transaction will ensure that created files arere-created in recovered environments (or do not appear at all).Additional database operations or operations on other databases can beincluded in the same transaction, of course.  In the simple case, wherethe open is the only operation in the transaction, an application canset the m4_ref(DB_AUTO_COMMIT) flag instead of creating and managingits own transaction handle.  The m4_ref(DB_AUTO_COMMIT) flag willinternally wrap the operation in a transaction, simplifying applicationcode.])m4_p([dnlThe previous example is the simplest case of transaction protection fordatabase open.  Obviously, additional database operations can be donein the scope of the same transaction.  For example, an applicationmaintaining a list of the databases in a database environment in awell-known file might include an update of the list in the sametransaction in which the database is created.  Or, an application mightcreate both a primary and secondary database in a single transaction.])m4_p([dnlm4_ref(Db) handles that will later be used for transactionally protecteddatabase operations must be opened within a transaction.  Specifying atransaction handle to database operations using m4_ref(Db) handles notopened within a transaction will return an error.  Similarly, notspecifying a transaction handle to database operations that will modifythe database, using handles that were opened within a transaction, willalso return an error.])m4_page_footer

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -