1
<!--$Id: env_set_lg_bsize.so,v 10.14 2001/05/15 14:44:09 bostic Exp $-->
2
<!--Copyright 1997-2001 by Sleepycat Software, Inc.-->
3
<!--All rights reserved.-->
6
<title>Berkeley DB: DB_ENV->set_lg_bsize</title>
7
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
8
<meta name="keywords" content="embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,java,C,C++">
11
<a name="2"><!--meow--></a>
12
<table width="100%"><tr valign=top>
14
<h1>DB_ENV->set_lg_bsize</h1>
17
<a href="../api_c/c_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
25
DB_ENV->set_lg_bsize(DB_ENV *dbenv, u_int32_t lg_bsize);
28
<p>Set the size of the in-memory log buffer, in bytes. By default, or if
29
the value is set to 0, a size of 32K is used. The size of the log file
30
(see <a href="../api_c/env_set_lg_max.html">DB_ENV->set_lg_max</a>) must be at least four times the size of the
31
the in-memory log buffer.
32
<p>Log information is stored in-memory until the storage space fills up
33
or transaction commit forces the information to be flushed to stable
34
storage. In the presence of long-running transactions or transactions
35
producing large amounts of data, larger buffer sizes can increase
37
<p>The DB_ENV->set_lg_bsize interface may be used only to configure Berkeley DB before
38
the <a href="../api_c/env_open.html">DB_ENV->open</a> interface is called.
39
<p>The DB_ENV->set_lg_bsize function returns a non-zero error value on failure and 0 on success.
40
<p>The database environment's log buffer size may also be set using the environment's
41
<b>DB_CONFIG</b> file. The syntax of the entry in that file is a
42
single line with the string "set_lg_bsize", one or more whitespace characters,
43
and the size in bytes. Because the <b>DB_CONFIG</b> file is read when the database
44
environment is opened, it will silently overrule configuration done
47
<p>The DB_ENV->set_lg_bsize function may fail and return a non-zero error for the following conditions:
49
<p><dt>EINVAL<dd>An invalid flag value or parameter was specified.
50
<p>Called after <a href="../api_c/env_open.html">DB_ENV->open</a> was called.
51
<p>The size of the log file is less than four times the size of the in-memory
54
<p>The DB_ENV->set_lg_bsize function may fail and return a non-zero error for errors specified for other Berkeley DB and C library or system functions.
55
If a catastrophic error has occurred, the DB_ENV->set_lg_bsize function may fail and return
56
<a href="../ref/program/errorret.html#DB_RUNRECOVERY">DB_RUNRECOVERY</a>, in which case all subsequent Berkeley DB calls will fail
59
<a href="../api_c/env_set_lg_bsize.html">DB_ENV->set_lg_bsize</a>,
60
<a href="../api_c/env_set_lg_dir.html">DB_ENV->set_lg_dir</a>,
61
<a href="../api_c/env_set_lg_max.html">DB_ENV->set_lg_max</a>,
62
<a href="../api_c/env_set_lg_regionmax.html">DB_ENV->set_lg_regionmax</a>,
63
<a href="../api_c/log_archive.html">log_archive</a>,
64
<a href="../api_c/log_compare.html">log_compare</a>,
65
<a href="../api_c/log_file.html">log_file</a>,
66
<a href="../api_c/log_flush.html">log_flush</a>,
67
<a href="../api_c/log_get.html">log_get</a>,
68
<a href="../api_c/log_put.html">log_put</a>,
69
<a href="../api_c/log_register.html">log_register</a>,
70
<a href="../api_c/log_stat.html">log_stat</a>,
72
<a href="../api_c/log_unregister.html">log_unregister</a>.
74
<table width="100%"><tr><td><br></td><td align=right>
75
<a href="../api_c/c_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
77
<p><font size=1><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font>