Question

I'm using DB4O with transparent persistence/activation using msbuild enhancement as my preferred database for an ASP.NET MVC Intranet collaborative editing application. I have a few simple questions:

If I call commit() after every set of change, without ever closing my IObjectContainer in the client or server. When my WebApp crashes or get shutdown improperly, would my data still be there and intact?

As there isn't a ActivatableHashSet or ActivatableSortedSet, if I use .Net's HashSet or SortedSet or other non-TA/TP Collection types, how do I properly handle persistence when these collection change? (e.g. when these collections are members of TA classes), e.g.

[Persisted]
class A<T> where T : new()
{
  HashSet<T> stuff = new ...
  void AddMore() { stuff.Add(new T()) }
}
Was it helpful?

Solution

If I call commit() after every set of change, without ever closing my IObjectContainer in the client or server. When my WebApp crashes or get shutdown improperly, would my data still be there and intact?

Yes, see this documentation for more information about transactions in db4o.

But pay attention: calling commit to often will kill the performance. You'll need to profile your app to find a balance.

As there isn't a ActivatableHashSet or ActivatableSortedSet, if I use .Net's HashSet or SortedSet or other non-TA/TP Collection types, how do I properly handle persistence when these collection change? (e.g. when these collections are members of TA classes), e.g.

I highly recommend you to download and see the official TA/TP enabled collections implementation

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top