Repo, along with the exception at the bottom of the mail.
Cheers,
Rob
open Raven.Client
open Raven.Client.Document
type MyRecord =
{ mutable Id: string
MyField: string }
let populate() =
let x = { Id = null; MyField = "A test" }
use store = new DocumentStore(Url = "http://localhost:8080")
store.Initialize() |> ignore
use session = store.OpenSession()
session.Store(x)
session.SaveChanges()
//populate()
let main() =
use store = new DocumentStore(Url = "http://localhost:8080")
store.Initialize() |> ignore
use session = store.OpenSession()
let x = session.Load<MyRecord>("myrecords/1")
let x' = { x with MyField = "another test" }
session.Store(x')
session.SaveChanges()
main()
Unhandled Exception: Raven.Client.Exceptions.NonUniqueObjectException: Attempted
to associated a different object with id 'myrecords/1'.
at Raven.Client.Document.InMemoryDocumentSessionOperations.Store(Object entit
y) in c:\Builds\raven\Raven.Client.Lightweight\Document\InMemoryDocumentSessionO
perations.cs:line 529
at Program.main() in c:\code\TestImmutableDocStorage\TestImmutableDocStorage\
Program.fs:line 25
at <StartupCode$TestImmutableDocStorage>.$Program.main@() in c:\code\TestImmu
tableDocStorage\TestImmutableDocStorage\Program.fs:line 28