Manual transactions with rlinq

4 posts, 0 answers
  1. Saene
    Saene avatar
    13 posts
    Member since:
    Sep 2008

    Posted 18 May 2011 Link to this post

    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.
  2. Damyan Bogoev
    Admin
    Damyan Bogoev avatar
    581 posts

    Posted 20 May 2011 Link to this post

    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.
  3. DevCraft banner
  4. yjh
    yjh avatar
    67 posts
    Member since:
    Aug 2007

    Posted 28 May 2011 Link to this post

    Is that mean when using "new" Open Access ORM, almost doesn't need to care about transaction?
  5. Damyan Bogoev
    Admin
    Damyan Bogoev avatar
    581 posts

    Posted 31 May 2011 Link to this post

    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.
Back to Top