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

Commit

1 Answer 83 Views
General Discussions
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 12 Nov 2008, 10:11 AM
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,

Antoine.

1 Answer, 1 is accepted

Sort by
0
Thomas
Telerik team
answered on 12 Nov 2008, 11:08 AM
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.

Regards,
Thomas
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
General Discussions
Asked by
Saene
Top achievements
Rank 1
Answers by
Thomas
Telerik team
Share this question
or