Is it OK to open a DB4o file for query, insert, update multiple times?

后端 未结 2 1270
星月不相逢
星月不相逢 2021-01-14 21:42

This is the way I am thinking of using DB4o. When I need to query, I would open the file, read and close:

using (IObjectContainer db = Db4oFactory.OpenFile(         


        
2条回答
  •  灰色年华
    2021-01-14 21:59

    It is ok to reopen the database multiple times. The problem would be performance and loosing the "identity". Also you can't keep a reference to a result of a query and try to iterate it after closing the db (based on you code, looks like you want to do that).

    GenericObjects are instantiated when the class cannot be found.

    Can you provide a full, minimalist, sample that fails for you?

    Also, which db4o version are you using?

    Best

提交回复
热议问题