Coder Social home page Coder Social logo

Comments (14)

mbdavid avatar mbdavid commented on August 15, 2024

Hi @sherry-ummen, the problem is: you are serializing an Object (in this case, a List<Object>).

LiteDB serialize/deserialize objects using object type to know where put a field data. To serialize is a problem, but when you try to deserialize it´s not possible because there are no destination type to match all document (BsonDocument).

from litedb.

sherry-ummen avatar sherry-ummen commented on August 15, 2024

Thanks David.

Is it possible to improve this? Since the same code for MongoDb works pretty nicely.

Sent from my Windows Phone


From: Mauricio Davidmailto:[email protected]
Sent: ‎30/‎04/‎2015 17:30
To: mbdavid/LiteDBmailto:[email protected]
Cc: Sherry Ummenmailto:[email protected]
Subject: Re: [LiteDB] Object not being serialized or deserialized correctly? (#27)

Hi @sherry-ummen, the problem is: you are serializing an Object (in this case, a List<Object>).

LiteDB serialize/deserialize objects using object type to know where put a field data. To serialize is a problem, but when you try to deserialize it´s not possible because there are no destination type to match all document (BsonDocument).


Reply to this email directly or view it on GitHub:
#27 (comment)

from litedb.

mbdavid avatar mbdavid commented on August 15, 2024

I will made some tests with MongoDB driver to know how they store a document from an Object. I will add to my todo list and try to be avaiable in next version

from litedb.

sherry-ummen avatar sherry-ummen commented on August 15, 2024

Great thanks David.

from litedb.

mbdavid avatar mbdavid commented on August 15, 2024

There is a new version on Nuget/Github Release: 1.0.1 fixing this problem.

from litedb.

sherry-ummen avatar sherry-ummen commented on August 15, 2024

hi,
I tested it but still my issue was not fixed with the changes. So I quickly had a look at whats wrong and did some small changes to get it working with my code. Here is the commit
sherry-ummen@121fbf0

All the unit tests pass.

from litedb.

mbdavid avatar mbdavid commented on August 15, 2024

Hi @sherry-ummen, thanks for your feedback. I will test your code and join this issue with #31 that is same problem. Now I do more tests before release new version.

from litedb.

mbdavid avatar mbdavid commented on August 15, 2024

Hi @sherry-ummen, I use part of your code to create implement deserialize to IList<> and IDictionary<,>. Can you test master branch in your app? Thanks

from litedb.

sherry-ummen avatar sherry-ummen commented on August 15, 2024

thanks @mbdavid ur fix works like charm 😃

from litedb.

sherry-ummen avatar sherry-ummen commented on August 15, 2024

oops hold on seems one case still not working. I will let you know soon. Sorry for being joyous too early :)

from litedb.

sherry-ummen avatar sherry-ummen commented on August 15, 2024

Sorry for late reply as I was on vacation. So the case which did not work was when you put the property value to be Enummerable.Range(1,9999) then it failes with exception index out of bound.

You/me can create a seperate issue if you like for this.

it works in mongodb.

from litedb.

sherry-ummen avatar sherry-ummen commented on August 15, 2024

Hi David,

I want to ask one thing.

Can we somehow make a mechanism to avoid this overhead of Start and End transaction. I just want to write it without that and just leave rest to the underlying API to write.

I tried a simple test that where I am doing random read and write and for that I always have to Start and End transaction for write which slows down the process.

Any solution or suggestion?

Thanks

Sent from Windows Mail

From: Mauricio David
Sent: ‎Sunday‎, ‎May‎ ‎24‎, ‎2015 ‎12‎:‎54‎ ‎AM
To: mbdavid/LiteDB
Cc: Sherry Ummen

Closed #27.


Reply to this email directly or view it on GitHub.

from litedb.

mbdavid avatar mbdavid commented on August 15, 2024

Hi @sherry-ummen, I open a new issue for this bug: #38

About start/end transaction: I use transaction to avoid concurrency writes. Transaction lock datafile so there is no 2 users writing at same time.

It´s quite ease to "remove" this, if you want more performance and less overhead.

I´m planning to v.1.1 create a Stream layer to control this - so you can use MemoryStream, assembly resource stream or even FileStream without transactions, locks and journal writes. More performance but less control - ideal do one user application.

from litedb.

sherry-ummen avatar sherry-ummen commented on August 15, 2024

Nice I eagerly wait for that.

Could you also provide a property or some configuration parameter to the LiteDB so that we can set the max BsonDocument size also? I can always compile it by myself also but thought that 1 Mb is still quite low and can easily shoot up in case heavy geometry app.

I am planning to test this in a real heavy write and read in an intense desktop application.

Sent from Windows Mail

From: Mauricio David
Sent: ‎Thursday‎, ‎May‎ ‎28‎, ‎2015 ‎7‎:‎55‎ ‎PM
To: mbdavid/LiteDB
Cc: Sherry Ummen

Hi @sherry-ummen, I open a new issue for this bug: #38

About start/end transaction: I use transaction to avoid concurrency writes. Transaction lock datafile so there is no 2 users writing at same time.

It´s quite ease to "remove" this, if you want more performance and less overhead.

I´m planning to v.1.1 create a Stream layer to control this - so you can use MemoryStream, assembly resource stream or even FileStream without transactions, locks and journal writes. More performance but less control - ideal do one user application.


Reply to this email directly or view it on GitHub.

from litedb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.