4 Answers, 1 is accepted
0
Hi Alec,
All operations that make changes to the database are encapsulated within a transaction. This ensures that all changes are committed at once to the database. It also provides the ability to rollback the changes if something bad happens, so the database will not be polluted. Transactions are managed by the ObjectScope.Transaction property and its Begin, Commit and Rollback methods. Note that only one transaction can be active at the same time for each object scope instance. I believe you will find this Knowledge base article useful.
Kind regards,
Alexander
the Telerik team
Check out Telerik Trainer , the state of the art learning tool for Telerik products.
All operations that make changes to the database are encapsulated within a transaction. This ensures that all changes are committed at once to the database. It also provides the ability to rollback the changes if something bad happens, so the database will not be polluted. Transactions are managed by the ObjectScope.Transaction property and its Begin, Commit and Rollback methods. Note that only one transaction can be active at the same time for each object scope instance. I believe you will find this Knowledge base article useful.
Kind regards,
Alexander
the Telerik team
Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Nathan Heberley
Top achievements
Rank 2
answered on 10 Aug 2009, 08:05 AM
What if you want to make an alteration to an object whichyou are not going to persist?
In my sinario I'm binding Hierarchical data to a panelbar, I have to knock off the root Item and then update the root items children to contain a parentID value of 0 so that the auto binding will work.
I have no intention of persisting these values but I get the error mentioned.
Do you have a solution ?
0
Nathan Heberley
Top achievements
Rank 2
answered on 10 Aug 2009, 08:50 AM
I have founbd a solution bu I would prefer to find an alternative.
I rebuilt the returned List and created new objects for each one I wanted to alter.
This solution is fine for the particular use but I would like to know if there is an alternative for the case where there are allot of objects that need alteration.
0
Hi Nathan Heberley,
The only way to edit an object out of transaction is when the object has not yet been added to an ObjectScope. For all other cases, an active transaction is necessary.
In order not to persist the alterations to already existing in the scope objects, you can use a transaction and call Transaction.Rollback() at the end to cancel the changes. Hope I understood you correctly.
Best wishes,
Alexander
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
The only way to edit an object out of transaction is when the object has not yet been added to an ObjectScope. For all other cases, an active transaction is necessary.
In order not to persist the alterations to already existing in the scope objects, you can use a transaction and call Transaction.Rollback() at the end to cancel the changes. Hope I understood you correctly.
Best wishes,
Alexander
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.