Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Your platform does not support FileStream.Lock #23

Closed
akucheck opened this issue Feb 18, 2019 · 2 comments
Closed

Your platform does not support FileStream.Lock #23

akucheck opened this issue Feb 18, 2019 · 2 comments

Comments

@akucheck
Copy link

It appears that LiteDB now needs a config setting for mode=exclusive on MacOS. I cannot find a way to do this. On initial load, once compile has finished I'm getting this:
litedb fsharp mode error

@Zaid-Ajaj
Copy link
Owner

Hello @akucheck, looks like you are running tabula-rasa project. Setting the connection string happens in here in case you using the local database, which uses the absolute file name of the databse as the connection string.

You can override that and use the following instead:

let createDatabaseUsing store =
    let mapper = FSharpBsonMapper()
    match store with
    | Store.InMemory -> 
        let memoryStream = new System.IO.MemoryStream()
        new LiteDatabase(memoryStream, mapper)
    | Store.LocalDatabase -> 
        let dbFile = Environment.databaseFilePath
        // extend the connection string here
        let connectionString = sprintf "Filename=%s; Mode=Exclusive" dbFile 
        new LiteDatabase(connectionString , mapper)

Can you check whether this fixes the problem for you?

@akucheck
Copy link
Author

akucheck commented Feb 18, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants