Explicit transaction control

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
salim_naufal
Posts: 11
Joined: Mon 30 Nov 2009 09:12
Location: Lebanon

Explicit transaction control

Post by salim_naufal » Mon 30 Nov 2009 09:23

I have a multi-thredded application and would like to take full control of transactions.
This is the scenario.
Thread 1: Start Transaction, execute a set of SQL commands, Commit transaction
Thread 2: Start Transaction, execute another set of SQL commands, Commit Transaction

I am sharing the same TMSConnection component. When thread 2 is running, executing "commit transaction" will commit for both threads.

Is there a way of assigning SQL statements to a specific Transaction?
I have experience with Interbase/Firebird where SQL components have a property linking it to a specific transaction component.

Thanks

Salim

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Mon 30 Nov 2009 10:40

SDAC doesn't support such functionality, because, unlike InterBase, SQL Server doesn't support parallel transactions. You should use some connections (TMSConnection components) to create some parallel transactions.

salim_naufal
Posts: 11
Joined: Mon 30 Nov 2009 09:12
Location: Lebanon

Post by salim_naufal » Mon 30 Nov 2009 16:12

Thanks for the info. I am still learning about MsSQL.
Best Regards
Salim

Post Reply