473,569 Members | 2,676 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error: Cannot create new connection because in manual or distributed transaction mode

CJM
I have page that starts a transaction and runs several StoredProcs before
committing or rollingback. An initial SP create a header records, and then
the code goes into a loop and runs 4 other SP's once per iteration.

I'd had it working previous, but now I have changed one of the SPs and the
order that they all run in...

Structure of Code:

oConn.BeginTran s

sSQL = "Exec etc"
oConn.Execute sSQL

Do While <some condition>

sSQL = "Exec etc"
oConn.Execute sSQL

sSQL = "Exec etc"
rs = oConn.Execute (sSQL)

sSQL = "Exec etc"
oConn.Execute sSQL <---- fails here

sSQL = "Exec etc"
oConn.Execute sSQL

Loop

oConn.CommitTra ns

I have no idea what this error means, nor why it is occuring now. The most
significant changes I have made have been on the two preceding SPs, and note
that the 2nd one, now returns a value.

Any ideas?

Chris

Jul 19 '05 #1
2 12898
CJM wrote:
I have page that starts a transaction and runs several StoredProcs
before committing or rollingback. An initial SP create a header
records, and then the code goes into a loop and runs 4 other SP's
once per iteration.

Is there any chance that you can put all of this logic into a single stored
procedure? It seems to me that in addition to having better control over the
transaction handling, using a single call to a stored procedure will be much
more efficient than calling a procedure multiple times in a loop. I've done
things like sending a delimited string of data to a procedure as a single
parameter where it is parsed and processed to avoid making multiple calls to
the database. Is something like this possible? If not, you might wish to
consider inserting the data that needs to be processed into a work table,
and then calling a single procedure to handle it.

Bob Barrows

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 19 '05 #2
CJM
Thanks, Bob.

Is there a chance I can put into one procedure? An outside chance perhaps!
lol

If I had a better grasp of T-SQL, I would probably do that. It is probably
not that different, but I'm vastly more experienced with ASP/VBScript, so I
have stuck with what I know.

However, this is one of those ridiculous rush jobs so I dont have any time
to invest in this. [We identified that a db was needed in Aug '03, the new
service started Jan '04, DB to support new service was requested in Mar
'04!]

I've found a workaround - using a seperate connection for the one SP that
returns a value. Hardly ideal, but it buys me some time.

However, I'm making a list of post-project tasks; I'll add combining SPs to
it.

"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcom> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
CJM wrote:
I have page that starts a transaction and runs several StoredProcs
before committing or rollingback. An initial SP create a header
records, and then the code goes into a loop and runs 4 other SP's
once per iteration.
Is there any chance that you can put all of this logic into a single

stored procedure? It seems to me that in addition to having better control over the transaction handling, using a single call to a stored procedure will be much more efficient than calling a procedure multiple times in a loop. I've done things like sending a delimited string of data to a procedure as a single
parameter where it is parsed and processed to avoid making multiple calls to the database. Is something like this possible? If not, you might wish to
consider inserting the data that needs to be processed into a work table,
and then calling a single procedure to handle it.

Bob Barrows

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
5020
by: Wayno | last post by:
My php logs are coming up empty. I have done all I can think of, and all that made sense to me. Can someone take a look at my php.ini please and tell me what you think may be the problem. I double-checked the path to my error log. It is in /var/www/logs/php_error_log Thanks. :) -Wayne Stevenson
7
13891
by: Prashanth | last post by:
Hi, We are facing some issues in COM+ deployment. We get system error "Unable to enlist in a distributed transaction" . It has a very inconsistant behaviour. On refreshing the screens couple of times, the error disappears.Also it reappears abruptly giving an impression that the transaction failed although the changes are commited to the...
0
3632
by: Sam Commar | last post by:
We are using a Standard Microsoft Product called Solomon which has a Web interface. We have installed this in more than 50 sites but we are getting the following error after being in the Web application for a few minutes: 'cannot create new connection because in manual or distributed transaction mode' Could someone provide some help on...
0
1264
by: faktujaa | last post by:
Hi, I receive the above error in my code when in debug mode but im not using serviced components instead im making use of sql server transaction. In short, I have defined a transaction class that is derived from connection class. In the constructor, i open a connection if one not already present and then start the transaction by using...
1
6406
by: Zri Man | last post by:
The Error in play is CLI Driver] SQL30020N Execution failed because of a Distributed Protocol Error that will affect the successful execution of subsequent commands and SQL statements: Reason Code "". SQLSTATE=58009 sqlstate = 40003 My Target is a DB2/UDB 8.2.2 database on SuSE Linux. This has been happening regularly.
0
3007
by: gshawn3 | last post by:
Hi, I am having a hard time creating a Trigger to update an Oracle database. I am using a SQL Server 2005 Express database on a Win XP Pro SP2 desktop, linked to an Oracle 10g database on a remote Windows 2003 server. Both machines are on the same domain and very close physically (<1ms ping). I have set up the Oracle linked server in...
0
1278
by: cristo | last post by:
I, After reading all what I could find I have some question about transaction and connection pooling. Let`s look at an example : Dim _transOpt As TransactionOptions _transOpt.IsolationLevel = IsolationLevel.ReadCommitted
2
17848
by: Martin Z | last post by:
I'm using the TableAdapterHelper to set the connection and transaction properties on all the commands of all my typed table adapters.... I've checked at the time of the error and all the commands have their Transaction property set. But I still get this error when I call... documentTA.Update(documentDS.Document); "ExecuteReader requires...
10
6944
by: happyse27 | last post by:
Hi All, I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration of section c. Not sure where went wrong as the web page displayed internal server error. Also, what is the error 543? and error 2114....
0
7697
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8120
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7672
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5512
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1212
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.