This project is read-only.

Seriliase HashSets (SOLVED)

Dec 26, 2012 at 1:22 PM

Hi,

Really Nice project.

I tried it with a my project and it nearly worked out of the box. I had to change a HashSet property to a List to make it work, but apart from that it was extremely easy to setup and is actually very fast to serialise and deserialise!

Are there any plans to add Hashet serialisation?

Thanks.

Ben

Dec 27, 2012 at 1:03 PM

Thanks for catching that! Bug is already fixed in master_HashSet_bug branch, so it will be the part of next release (which will happen soon ;)

 

Additionally release will contain:

- Change CriteriaQuery query engine to SODA query engine (similar to used by db4o) http://sourceforge.net/projects/sodaquery/

- LINQ to NDatabase, which will translate LINQ queries to SODA NDatabase queries

- LinqPad support (via Static Provider with instructions/samples about TypedDataContext)

- Norhtwind DB generator, from sql server to NDatabase

- already prepared northwind.ndb database with TypedDataContext for querying via LinqPad

- all collections, generic collections will be treated as native objects (which will resolve your issue), so they could be saved directly into NDatabase

- and more :)

Dec 27, 2012 at 11:42 PM

Great stuff.

Pulled the latest commit and the code works perfectly with HashShets now. Thanks.

I did notice:

 - A slight increase in serialisation time in my performance tests. De-serialisation is still as fast as before.

 - Query<T>() is now AsQuerayble<T> which actually makes more sense. (so I had to update my code a bit).

 - Checked the SODA site very quickly but finding some documentation was not straight forward.

 

The LinqPad support will be a great plus. I haven't tried it yet, but like using LinqPad when I am prototyping.

Will NDatabase provide an easy machanism to go from/to relational databases in the future or at least provide a language translator from SQL to LINQ? (or is that what SODA is meant for?)

Dec 28, 2012 at 6:54 AM

"A slight increase in serialization time in my performance tests. De-serialization is still as fast as before"

-> Caused by treating collections as non native objects, now the whole collections are serialized, not only simulated by limited native objects

 


 

"Query<T>() is now AsQuerayble<T> which actually makes more sense. (so I had to update my code a bit)."

-> old Query<T>()  is removed, new Query<T>() is the factory method for creating query, AsQueryable<T> is IQueryable correspondence to SODA Query<T>().Execute<T>()

 


 

Whole Query API is changed, so changes needs to be done on client side too (if queries were used often). But that's the final Query API for the NDatabase, which will be extended in the future. (Breaking change)

Additionally, db layer (binary) is changed too, so the way how to treat collections. I will prepare converter between 2.0-2.3 -> new release.

 


 

"Checked the SODA site very quickly but finding some documentation was not straight forward."

-> Agree, but during the release the actual documentation will be delivered/updated too :)

 


 

"Will NDatabase provide an easy mechanism to go from/to relational databases in the future or at least provide a language translator from SQL to LINQ? (or is that what SODA is meant for?)"

-> For the direction 'to relational databases', the xml import/export will be prepared, the further processing of that (or directly from NDatabase) to any relational db depends from users.

-> For the direction 'from relational databases' in terms of moving data, that will be definitely researched. Ticket for that: http://ndatabase.codeplex.com/workitem/891

-> more info about SODA http://sodaquery.sourceforge.net/, query similar to what you have there: http://community.versant.com/documentation/reference/db4o-7.12/java/reference/html/content/object_lifecycle/querying/soda_query/soda_query_api.html

Dec 28, 2012 at 11:23 PM

Just noticed NDatabase3 with updated docs! Thanks

Just have a few more questions:

- Is it possible to pre-register types with the database before adding objects (to speed up serialisation?

- Is it possible to ignore some fields and properties in a class, so that they don't get stored?

Dec 29, 2012 at 6:39 AM
Edited Dec 29, 2012 at 6:39 AM

Ad1. That's already happen in lazy way, so when first object of type is met, the class meta data is created and then reused for all objects

Ad2. Yes, take a look pls on NonPersistent