1<!--$Id: notes.so,v 10.32 2006/09/15 18:54:47 bostic Exp $-->
2<!--Copyright (c) 1997,2008 Oracle.  All rights reserved.-->
3<!--See the file LICENSE for redistribution information.-->
4<html>
5<head>
6<title>Berkeley DB Reference Guide: Windows notes</title>
7<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
8<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++">
9</head>
10<body bgcolor=white>
11<a name="2"><!--meow--></a>
12<table width="100%"><tr valign=top>
13<td><b><dl><dt>Berkeley DB Reference Guide:<dd>Building Berkeley DB for Windows systems</dl></b></td>
14<td align=right><a href="/build_win/test.html"><img src="/images/prev.gif" alt="Prev"></a><a href="/toc.html"><img src="/images/ref.gif" alt="Ref"></a><a href="/build_win/faq.html"><img src="/images/next.gif" alt="Next"></a>
15</td></tr></table>
16<p align=center><b>Windows notes</b></p>
17<ol>
18<p><li>Berkeley DB does not support the Windows/95 platform.
19<p><li>Berkeley DB does not support replication on the Windows/98 or Windows/ME
20platforms.
21<p><li>On Windows/98 and Windows/ME, files opened by multiple processes do not
22share data correctly.  For this reason, the <a href="/api_c/env_open.html#DB_SYSTEM_MEM">DB_SYSTEM_MEM</a> flag
23is implied for any application not specifying the <a href="/api_c/env_open.html#DB_PRIVATE">DB_PRIVATE</a>
24flag, causing the system paging file to be used for sharing data.
25<p><li>On Windows/98 and Windows/ME, removing or renaming a file using the
26<a href="/api_c/env_dbremove.html">DB_ENV-&gt;dbremove</a>, <a href="/api_c/env_dbrename.html">DB_ENV-&gt;dbrename</a>, <a href="/api_c/db_remove.html">DB-&gt;remove</a> or
27<a href="/api_c/db_rename.html">DB-&gt;rename</a> methods may fail if another thread of control has the file
28open for any reason, including checkpointing or flushing pages from the
29underlying shared database environment cache.  There is no workaround
30for this problem other than re-attempting the operation after the other
31thread of control has closed its Berkeley DB handles.
32<p><li>On Windows, system paging file memory is freed on last close.  For this
33reason, multiple processes sharing a database environment created using
34the <a href="/api_c/env_open.html#DB_SYSTEM_MEM">DB_SYSTEM_MEM</a> flag must arrange for at least one process to
35always have the environment open, or alternatively that any process
36joining the environment be prepared to re-create it.
37<p>If a system memory environment is closed by all processes, subsequent
38attempts to open it will return an error.  To successfully open a
39transactional environment in this state, recovery must be run by the
40next process to open the environment.  For non-transactional
41environments, applications should remove the existing environment and
42then create a new database environment.</p>
43<p><li>When using the <a href="/api_c/env_open.html#DB_SYSTEM_MEM">DB_SYSTEM_MEM</a> flag, Berkeley DB shared regions are
44created without ACLs, which means that the regions are only accessible
45to a single user.  If wider sharing is appropriate (for example, both
46user applications and Windows/NT service applications need to access
47the Berkeley DB regions), the Berkeley DB code will need to be modified to create
48the shared regions with the correct ACLs.  Alternatively, by not
49specifying the <a href="/api_c/env_open.html#DB_SYSTEM_MEM">DB_SYSTEM_MEM</a> flag, filesystem-backed regions
50will be created instead, and the permissions on those files may be
51directly specified through the <a href="/api_c/env_open.html">DB_ENV-&gt;open</a> method.
52<p><li>Applications that operate on wide character strings can use the
53Windows function WideCharToMultiByte with the code page CP_UTF8 to
54convert paths to the form expected by Berkeley DB.  Internally, Berkeley DB calls
55MultiByteToWideChar on paths before calling Windows functions.
56<p><li>Various Berkeley DB methods take a <b>mode</b> argument, which is intended
57to specify the underlying file permissions for created files.  Berkeley DB
58currently ignores this argument on Windows systems.
59<p>It would be possible to construct a set of security attributes to pass to
60<b>CreateFile</b> that accurately represents the mode.  In the worst
61case, this would involve looking up user and all group names, and creating
62an entry for each.  Alternatively, we could call the <b>_chmod</b>
63(partial emulation) function after file creation, although this leaves us
64with an obvious race.</p>
65<p>Practically speaking, however, these efforts would be largely meaningless
66on a FAT file system, which only has a "readable" and "writable" flag,
67applying to all users.</p>
68</ol>
69<table width="100%"><tr><td><br></td><td align=right><a href="/build_win/test.html"><img src="/images/prev.gif" alt="Prev"></a><a href="/toc.html"><img src="/images/ref.gif" alt="Ref"></a><a href="/build_win/faq.html"><img src="/images/next.gif" alt="Next"></a>
70</td></tr></table>
71<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
72</body>
73</html>
74