Thread is closed for posting
2 posts, 0 answers
  1. Saene
    Saene avatar
    13 posts
    Member since:
    Sep 2008

    Posted 12 Nov 2008 Link to this post

    Hi forum,

    I have a quick question.

    When calling the "commit" method (or "rollback"), is the transaction made inactive just after the call, or may it occurs sometime that the transaction remains active (even some milliseconds).

    I have a multi threaded application, and it seems that although I have put some protection on the transaction not to allow several threads accessing the database at the same time, I some times have an error when trying to open a transaction: "Transaction already active".

    So do I have to wait for the transaction to be inactive after a commit or a rollback to allow another thread to open it again?

    Thanks for your response,

  2. Thomas
    Thomas avatar
    590 posts

    Posted 12 Nov 2008 Link to this post

    Hi Antoine,

    the real database transaction is active only during the IObjectScope.Commit() time. The only exception to this is when you are working with pessimistic concurrency control setting locks explicitly; then the database connection is obtained at that time and released within the Commit().

    When you are accessing the same IObjectScope instance from multiple threads, it is necessary to use the multiThreaded backend configuration option; otherwise all concurrent accesses are not properly synchronized.
    Please see the respective section in the documentation for more details.

    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top