dbTalk Databases Forums  

Berkeley DB under .NET - Resource management

comp.databases.berkeley-db comp.databases.berkeley-db


Discuss Berkeley DB under .NET - Resource management in the comp.databases.berkeley-db forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Karl Waclawek
 
Posts: n/a

Default Berkeley DB under .NET - Resource management - 11-14-2005 , 03:08 PM







I am currently creating a C# 2.0 wrapper for the basic BDB structures
(Environment, Cursors, Transactions, Sequences).

This seems to work fine so far, but the main difficulty
I am currently facing is how to protect resources and
prevent access violations in case of programmer error.
This is mostly difficult because I don't quite understand
how resources are freed internally in BDB.

Apparently, closing one object may also implicitly close another.
For instance: when a parent transaction is closed (aborted/committed),
it automatically closes child transactions, so one must no call
Abort/Commit on the child transaction, if one does not want to get
memory access violations/segfaults.

So, I need to track a few dependencies.
My initial questions are:

a) If I close the environment, what else need closing?
databases? sequences? transactions?

b) If I close the database, does that really de-allocate all cursors?
Does it also close/de-allocate the sequences?

this questions are not about proper programming, but about
protecting against improper programming. Basically, I need
to write the finalization code such that it cleans up everything
in the right order, without calling Close() when not needed,
as this would cause access violations.

Grateful for any feedback,

Karl




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.