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

Manual transactions with rlinq

3 Answers 64 Views
Development (API, general questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Saene
Top achievements
Rank 1
Saene asked on 18 May 2011, 11:08 AM
Hi forum,

I'm developping a new application, by using the new way of working of OpenAccess.
I used forward mapping, which created the db from the entity diagram (rlinq) I defined.

I now have 2 questions, which I was able to answer to with the OpenAccess ORM classic version (the previous app i developped was with it):
- First, how can I handle manually the transactions? Within how the software architecture is defined, the transaction management is part of the logic: several unitary requests to be considered as a whole (atomicity), but executed within several data access classes (because of different area of concerns). Typically, i want to be able to: 1: open a transaction, 2: do something with my objects, 3: commit (or rollback) my transaction

- Second, my application has several threads. I cannot find much explainations on how to handle multithreaded applications when using rlinq. In the rlinq model, the show model settings / backend settings allow to define the transaction mode, a multithreaded context, and an isolation level. My wish is to allow only one thread to access the database at a time, which I was not able to achieve when I played with these options.

I have searched for several days, but cannot find any information on that 2 points. Can i still work with the "new" ORM, or should i get back to the classic version for my concerns?

Hope somebody can help,

Tx in advance,

Antoine.

3 Answers, 1 is accepted

Sort by
0
Damyan Bogoev
Telerik team
answered on 20 May 2011, 04:32 PM
Hello Saene,

1.    The transaction will be started automatically during OpenAccessContext.SaveChanges() or  OpenAccessContext.ClearChanges().
2.    To achieve that goal you should use pessimistic transaction locking. In order to set the transaction locking for your domain model you should do the following steps:
-    Run the Model Settings dialog;
-    Go to the Runtime Configuration section under the Backend Settings tab;
-    Select the correct setting from the Transaction Locking combo box;
Hope that helps.

Kind regards,
Damyan Bogoev
the Telerik team
Q1’11 SP1 of Telerik OpenAccess is available for download; also available is the Q2'11 Roadmap for Telerik OpenAccess ORM.
0
yjh
Top achievements
Rank 1
answered on 28 May 2011, 06:28 PM
Is that mean when using "new" Open Access ORM, almost doesn't need to care about transaction?
0
Damyan Bogoev
Telerik team
answered on 31 May 2011, 06:23 AM
Hi Saene,

You do not need to explicitly start and commit/rollback a transaction in order to execute CRUD operations using the OpenAccessContext.
Additional helpful information regarding the transaction handling and how to work with them can be found here.

Best wishes,
Damyan Bogoev
the Telerik team
Q1’11 SP1 of Telerik OpenAccess is available for download; also available is the Q2'11 Roadmap for Telerik OpenAccess ORM.
Tags
Development (API, general questions)
Asked by
Saene
Top achievements
Rank 1
Answers by
Damyan Bogoev
Telerik team
yjh
Top achievements
Rank 1
Share this question
or