The EntitySpaces Community

Share and learn about the EntitySpaces Architecture.
Welcome to The EntitySpaces Community Sign in | Join | Help
in
Home Forums Photos

Caching, concurrency and a few other questions

Last post 08-25-2008, 4:50 AM by Mike.Griffin. 1 replies.
Sort Posts: Previous Next
  •  08-23-2008, 6:16 AM 10882

    Caching, concurrency and a few other questions

    Hi,

    A couple of questions regarding EntitySpaces:

    1. What are the ramifications of storing entities or entity collections in the asp.net Cache?

    2. If an entity collection is retrived from cache and used by two threads (read only) concurrently, would ES have any issues? I expect so...

    3. If an entity is loaded from cache then one of its foreign key collections accessed, would the db connection be correctly re-established?

    4. Say an entity collection of Countries is stored in cache, and used by two threads concurrently, what would be the correct thread safe method of searching thru the collection for a specific country by name (ie NOT by primary key)

    Thanks

     

  •  08-25-2008, 4:50 AM 10897 in reply to 10882

    Re: Caching, concurrency and a few other questions

    1) There are no real ramification as no connection is held onto, the only thing is of course the memory cost.

    2) ES currently does no locking at the collection level. This was a design issue, we decided that the over head of all the multi-threaded code was not worth the cost as it is far more common not to do this. That being said, there should be no problem reading from collections it would just be if you planned on inserting to them.

    3) Yes, the hierarchical model is lazy loaded, the first time that you access a hierarchical property/collection a trip is made to the database to load it.

    4) I think this ES feature would greatly help you, see this POST.

     


    EntitySpaces | Twitter | BLOG | Please honor our Software License
View as RSS news feed in XML