Saturday, August 25, 2012

First linux test

First successful run of RavenDB on linux today.  Compiled on windows, run on linux.  Man C# is pretty neat.


2 comments:

  1. I'm trying to use BDB on mono (not with RavenDB, directly), and you seem to be one of the few persons that is trying it too :-) I have seen that you were looking at the "default" .NET bindings for BDB and you got the problem with DB_ENV_api2_internal_set (you wrote about it in the ravendb google group) (I'm stuck at the same point), and you seemed to have found a solution, but looking at your github https://github.com/mweber26/ravendb/tree/bdb-storage you seem to be using Karl Waclawek's libdb-dotnet. Are you trying both of them?

    ReplyDelete
  2. First of all that is not the latest branch, https://github.com/mweber26/ravendb/tree/bdb-1.2 is the current branch.

    Yes I switched back to libdb-dotnet. I did end up getting the Oracle provider to work, but their unmanaged resource handling is horrible. And there is a lot of unnecessary buffer copies back and forth with respect to the DBT structures.

    I can dig up the code for getting the Oracle provider working if you want, but here is the basic idea. In mono you cannot store a pointer to a managed object without the object being "StructLayout-able". The BDB provider stores the managed environment object in an unmanaged structure pointer. We can get around this by converting the DatabaseEnvironment arguments to void(void) delegates that point to empty methods in the DatabaseEnvironment class. Mono will correctly dispatch the delegates for us. Then when we want to access the actual data we want (which is the managed environment object), we can use the Target field of the delegate object.

    ReplyDelete