Berkeley DB Reference Guide:
Access Methods

PrevRefNext

Retrieved key/data permanence for C/C++

When using the non-cursor Berkeley DB calls to retrieve key/data items under the C/C++ APIs (for example, DB->get), the memory to which the pointer stored into the DBT refers is only valid until the next call to Berkeley DB using the DB handle. (This includes any use of the returned DB handle, including by another thread of control within the process. For this reason, when multiple threads are using the returned DB handle concurrently, one of the DB_DBT_MALLOC, DB_DBT_REALLOC or DB_DBT_USERMEM flags must be specified with any non-cursor DBT used for key or data retrieval.)

(Ä¿¼­¸¦ »ç¿ëÇÏÁö ¾Ê°í Å°/µ¥ÀÌŸ ¾ÆÀÌÅÛÀ» ÀÐÀ»¶§ DBTÀÇ Æ÷ÀÎÅÍ°ªÀº DBÇÚµéÀ» »ç¿ëÇÏ´Â ´ÙÀ½ call(¾î¶² ¾²·¹µå³ª ÇÁ·Î¼¼½ºÀÇ µðºñÇڵ鿡 ´ëÇÑ µ¿ÀÛ)ÀÌÀü±îÁö À¯È¿ÇÏ´Ù.ÀÌ°°Àº ÀÌÀ¯·Î ¸®ÅÏµÈ ÇϳªÀÇ DBÇÚµéÀ» ¿©·¯ ¾²·¹µå°¡ µ¿½Ã¿¡ »ç¿ëÇÒ¶§ Ä¿¼­¸¦ »ç¿ëÇÏÁö¾Ê´Â DBT³ª µ¥ÀÌŸ Àб⿡ ´ëÇؼ­´Â DB_DBT_MALLOC, DB_DBT_REALLOC or DB_DBT_USERMEM Ç÷¹±×ÁßÀÇ Çϳª¸¦ ¼³Á¤ÇØ¾ß ÇÑ´Ù.

¡¡

When using the cursor Berkeley DB calls to retrieve key/data items under the C/C++ APIs (for example, DBcursor->c_get), the memory to which the pointer stored into the DBT refers is only valid until the next call to Berkeley DB using the DBC handle returned by DB->cursor.

(Ä¿¼­¸¦ »ç¿ëÇÑ Å°/µ¥ÀÌŸ ÀбâÀÇ °æ¿ì DBCÇÚµéÀ» »ç¿ëÇÏ´Â ´ÙÀ½ ÇÔ¼öcall±îÁö DBTÀÇ ¸â¹ö°¡ °¡¸£Å°´Â Æ÷ÀÎÅÍ´Â À¯È¿ÇÏ´Ù.)


PrevRefNext

Copyright (c) 1996-2003 Sleepycat Software, Inc. - All rights reserved.