一个berkeley数据库可以同时从多个程序打开和访问? [英] can a berkeley database be opened and accessed from multiple programs at the same time?

查看:277
本文介绍了一个berkeley数据库可以同时从多个程序打开和访问?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据Berkeley文档的Transactional(TS)和数据库的并发数据存储版本,多个线程可以访问(和更改)数据库。



也意味着我可以有2个程序链接到berkely'客户端',并让他们访问相同的数据库文件没有任何问题?



(我问,因为对于单独的数据库服务器,这当然没有问题,但在伯克利的情况下,数据库引擎与您的程序链接长) / p>

感谢!



R

解决方案

一些文档似乎认为你可以从多个进程以及从多个线程同时使用同一个数据库。具体来说:



多个进程或单个进程中的多个线程都可以在每个使用Berkeley DB库的同时使用数据库低级服务例如锁定,事务日志,共享缓冲区管理,内存管理等等都由库来处理。



粗略的读取没有揭示什么BDB用于控制来自多个进程的访问,但是如果使用文件系统锁,则来自网络文件系统上的多个进程的访问可能是有问题的。


according to the Berkeley documentation the Transactional (TS) and the Concurrent Datastore version of the Database, multiple threads may access (and change) the database.

Does this also mean that I can have 2 programs linked to the berkely 'client' and have them access the same database file without any problems?

(I ask, since for a separate database server this would be no problem of course, but in the case of Berkeley the database engine is linked long with your program)

thanks!

R

解决方案

Some documentation seems to think you can use the same database concurrently from multiple processes as well as from multiple threads. Specifically:

"Multiple processes, or multiple threads in a single process, can all use the database at the same time as each uses the Berkeley DB library. Low-level services like locking, transaction logging, shared buffer management, memory management, and so on are all handled transparently by the library."

A cursory read did not shed any light on what BDB uses to control access from multiple processes, but if filesystem locks are used, access from multiple processes on a network filesystems may well be problematic.

这篇关于一个berkeley数据库可以同时从多个程序打开和访问?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆