Disconnected Scenario

2 posts, 1 answers
  1. Mehdi
    Mehdi avatar
    9 posts
    Member since:
    Jun 2012

    Posted 28 Oct 2012 Link to this post


    I am working on a winform project using entity framework as orm. but i have some difficulties with disconected entities.

    My model is little complex and i prefer to work in disconnected scenario. so user could add/edit entity and it's navigation properties(related entities) in different forms. and then with one transaction(SaveChanges) all entities should save into database.

    Now i just found OpenAccess. but i found Disconnected API under the "OpenAccess ORM Classic (Old API)". so i wonder is there something new replaced these API in new version?

    Also is there any sample using disconnected scenario? and finally when using ObjectContainer, is it ok to add objects from different db context which opened in different forms?


  2. Answer
    Boris Georgiev
    Boris Georgiev avatar
    190 posts

    Posted 30 Oct 2012 Link to this post

    Hello Mehdi,

    Telerik OpenAccess ORM is working by default disconnected. All the changes that are accumulated are applied by calling SaveChanges from the OpenAccess context.

    If you are interesting how we implement it, we are managing our connections using connection pooling and each connection is released right after the queries are executed. More about Connection Pool and how to configure it, you can read here: Connection pool configuration. Here is blog post about connection pool: Connection pool types

    You can see any of our quick-start scenarios because each of them implement disconnected scenario, and especially in your case WinForms quick-start scenario

    Also you can add objects from different OpenAccess contexts using our Attach-Detach API. Just make sure you do not attach one object to two contexts at the same time or to detach an object and forget to attach it again - those are the usual pitfalls in such cases. 

    Let me know if you need additional assistance.

    Kind regards,
    Boris Georgiev
    the Telerik team
    Telerik OpenAccess ORM Meets ASP.NET Web API. Read more.
  3. DevCraft banner
Back to Top