473,800 Members | 2,648 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SQLException timeout with nested Queries

Hi All,
I have a problem with nested SQLQueries. I will give here an abstract
sample of code which I wrote

Method A
{
createSqlTransa ction and
call SQL Insert Statement including "Select ScopeIdentity() ;"
try
{
call Method B
}
catch
{
Rollback Transaction
}
}

Method B
{
call another SQL Insert Statement including "Select ScopeIdentity() ;"
....
}
In "Method B" I get an SQLException with a Timeout Errormessage.

Can somebody help me?

Thanks in advance.

Jun 1 '06 #1
2 1957
Does it indicate what kind of timeout it is? Is it a timeout on the
transaction, or a timeout on the command?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

<Ge***********@ web.de> wrote in message
news:11******** **************@ g10g2000cwb.goo glegroups.com.. .
Hi All,
I have a problem with nested SQLQueries. I will give here an abstract
sample of code which I wrote

Method A
{
createSqlTransa ction and
call SQL Insert Statement including "Select ScopeIdentity() ;"
try
{
call Method B
}
catch
{
Rollback Transaction
}
}

Method B
{
call another SQL Insert Statement including "Select ScopeIdentity() ;"
...
}
In "Method B" I get an SQLException with a Timeout Errormessage.

Can somebody help me?

Thanks in advance.

Jun 1 '06 #2
It was a timeout on the SqlCommand object. I found out, that Sql-Server
can not handle nested transactions. The solution was to create an
SqlCommand object and bind a transaction to it. Then I assign the
SqlCommand object via reference to other methods where i can reuse the
object and in errorcase can rollback the transaction.

I just have to keep in mind to close the connection in the parent
method.

Thanks for all answers!

Greetings

Gerrit Horeis

--
Software Developer
http://www.xira.de
http://www.ci-gate.de

Jun 9 '06 #3

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

Similar topics

3
6473
by: Tcs | last post by:
My backend is DB2 on our AS/400. While I do HAVE DB2 PE for my PC, I haven't loaded it yet. I'm still using MS Access. And no, I don't believe this is an Access question. (But who knows? I COULD be wrong... :) I've tried the access group...twice...and all I get is "Access doesn't like ".", which I know, or that my query names are too long, as there's a limit to the length of the SQL statement(s). But this works when I don't try to...
4
17992
by: hb | last post by:
Hi, I got the "System.Data.SqlClient.SqlException: Timeout expired. " error on my web application while saving some data. Would you please tell me how to change the settings in SQL Server 2000 or IIS to increase the timeout?
3
16056
by: Matt | last post by:
I'm having an issue with returning a large amount of data into a dataset. When the query returns thousands of lines of data (in Query Analyzer it can take 2 minutes) I receive the following error: Message: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding....
0
4101
by: Ersin Gençtürk | last post by:
we are getting : System.Web.HttpUnhandledException: Exception of type System.Web.HttpUnhandledException was thrown. ---> System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) at...
4
1879
by: Stephen Noronha | last post by:
Hi, I have an unusual error, "System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding......and so on " I have never seen such an error. Yes, i do agree that the SP takes anywhere b/w 2-5 min to return data and i have no "connection timeout parameter" set in my web.config
14
7043
by: Marcus | last post by:
I have a function that simply returns TRUE if it can connect to a particular Sql Server 2005 express, or FALSE if it cannot. I am getting some strange error codes returned when the computer that sql server resides on is not reachable. The error is different depending on the connection string that I use. If I use the following connection string: "server=192.1.1.1; Initial Catalog=master; uid=The_User; password=The_Password; Connect...
7
3607
by: bylum | last post by:
Servlet SQLException Communication link failure java howto i can't connect jsp and database(mysql). This is the exception: exception org.apache.jasper.JasperException: javax.servlet.ServletException: java.sql.SQLException: Communication link failure: java.io.IOException, underlying cause: Unexpected end of input stream
22
5299
by: Nick Craig-Wood | last post by:
Did anyone write a contextmanager implementing a timeout for python2.5? I'd love to be able to write something like with timeout(5.0) as exceeded: some_long_running_stuff() if exceeded: print "Oops - took too long!"
2
1860
by: rajasoorya | last post by:
Hi, In my application.... i want to identify whther the SQLException caught is a Timeout or any other SQLException. The reason being, i have to show a different msg to the user in case it is a timeout error. Thank you in advance
0
9690
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10032
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9085
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7574
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5603
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2944
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.