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

Database Transactions inside Silverlight

1 Answer 54 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.
Alon
Top achievements
Rank 1
Alon asked on 23 Aug 2010, 09:51 PM
Hi,

I am a beginner with Telerik ORM and I already used the quick start guide to create a simple silverlight application that fetches and updates database tables.

I didn't find, though, how to create database transactions inside the silverlight control (begin, rollback, commit).

Is there any code example for that?

Thanks,
Alon 

1 Answer, 1 is accepted

Sort by
0
Serge
Telerik team
answered on 24 Aug 2010, 04:37 PM
Hi Alon,

Let me shed some light on how you can handle transaction like actions using the client context in Silverlight. First of all the objects you retrieve from the context are disconnected from it. The usual scenario will be to get some objects, modify them a bit and then call the update method on the context. Finally call the SubmitChanges method that will do a service call and update the actual database.

Here it is important to notice that the context will hold the changes you want to be persisted, it will work as a change set. If you want to rollback the changes you can easily create a new context that does not hold any changes. Or even use the old object with the new context, as they are disconnected it will work without problem.

To wrap it up, there is no need for a 'begin transaction', as it would automatically begin. The SubmitChanges method stands for a commit and you can easily rollback the changes when you create a new context.

I hope this helps. Please contact us back if you need further assistance.

Kind regards,
Serge
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Getting Started
Asked by
Alon
Top achievements
Rank 1
Answers by
Serge
Telerik team
Share this question
or