TMSConnection.StartTransaction error 'Cannot create new connection because in manual or distributed transaction mode'

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
wnfwnf
Posts: 1
Joined: Tue 25 Mar 2008 15:12

TMSConnection.StartTransaction error 'Cannot create new connection because in manual or distributed transaction mode'

Post by wnfwnf » Sun 30 Mar 2008 12:51

Hi,
I faced a proble when start a transaction(TMSConnection.StartTransaction), it show the error message 'Cannot create new connection because in manual or distributed transaction mode', how to solve it,

it's emergency, please tell the soluction.

thank very much!

1. a program include TMSConnection and TMSQuery, TMSQuery component 's CachedUpdates is true,
2.Open the TMSQuery component
3. Edit the record
4. start a transaction, then show the error message,

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Mon 31 Mar 2008 07:57

Most likely you are trying to start the transaction when there is an underfetched dataset (FetchAll is set to False) within the connection. You should either start the transaction before opening your dataset or force fetch before starting the transaction. You can force fetch by setting FetchAll to True.

upscene
Posts: 271
Joined: Thu 19 Oct 2006 08:13

Post by upscene » Thu 20 Oct 2011 08:53

Antaeus wrote:Most likely you are trying to start the transaction when there is an underfetched dataset (FetchAll is set to False) within the connection. You should either start the transaction before opening your dataset or force fetch before starting the transaction. You can force fetch by setting FetchAll to True.
I got this error as well, but I AM starting a transaction before doing .Open, nevertheless, when editing data while FetchAll is False and not all rows are fetched, I get this error.

Using SQL Server 7 or 2005 makes no difference.

Got a clue?

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

Post by Dimon » Thu 20 Oct 2011 15:59

To solve the problem set the TMSConnection.Options.MultipleActiveResultSets property to True.

upscene
Posts: 271
Joined: Thu 19 Oct 2006 08:13

Post by upscene » Thu 20 Oct 2011 17:04

I've tried that, but that messed up lots of other things with transaction errors.

Besides, won't this work for SQL Server 2005 and up only?

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

Post by Dimon » Fri 21 Oct 2011 13:08

These problems are connected with MARS, but not SDAC, and we can't influence it. You can find information about MARS and transactions here: http://blogs.msdn.com/b/cbiyikoglu/arch ... -3983.aspx

Post Reply