This is a migrated thread and some comments may be shown as answers.

Disconnected Scenario

1 Answer 93 Views
Getting Started
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Mehdi
Top achievements
Rank 1
Mehdi asked on 28 Oct 2012, 09:56 PM

Hi

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?

Thanks. 

1 Answer, 1 is accepted

Sort by
0
Accepted
Boris Georgiev
Telerik team
answered on 30 Oct 2012, 05:00 PM
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.
Tags
Getting Started
Asked by
Mehdi
Top achievements
Rank 1
Answers by
Boris Georgiev
Telerik team
Share this question
or