Environment:-
Framework 1.1
DB: SQL Server 2000 (SQL Provider)
OS: Windows 2000
Language: VB.NET
I'm trying to do mass inserts/updates. Using Transactions.
The table hierarchy contains 3 levels (TL1, TL2, and TL3):
Here is what I'm trying to accomplish:
1) Start Begin Transaction (in desperation, I've tried all
the isolation levels- I was hoping ReadUncommitted would
work!)
2) Do an Insert/Update in table TL1 (this works).
3) Grab the ID from step 2 and do a SELECT on table TL2 to
determine if I need to an UPDATE or INSERT.
Since I'd be inserting 3 rows into table TL2 (for a
particular parent ID with different types), the first
SELECT (on TL2) works and then I'm able to do an INSERT
into TL2. The transaction is still alive. Now, I try to do
a SELECT on table TL2 to see if a record exists for this
type and this is when I get the exception "Timeout
expired. The timeout period elapsed prior to completion
of the operation or the server is not responding."
My guess is that I have a LOCK on the table TL2 (from the
first SELECT), which seems to be causing the problem.
Note:
The INSERTs and UPDATEs are done by executing stored procs.
For the SELECTS, I'm using a different connection (from
the one which the transaction is using) and close it after
the SELECT is executed. 4 12639
Consider running all of the statements in a single stored procedure and let
SQL Server handle the transaction rather than roundtrip. You can also set
the CommandTimeout on the Command object(s), ConnectionTimeo ut on the
Connection object.
Even faster, consider using XML for your INSERTS, UPDATES and cascaded
DELETEs.
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
*************** *************** *************** *************** **********
Think Outside the Box!
*************** *************** *************** *************** **********
"Manoj K" <ma************ *@yahoo.com> wrote in message
news:01******** *************** *****@phx.gbl.. . Environment:- Framework 1.1 DB: SQL Server 2000 (SQL Provider) OS: Windows 2000 Language: VB.NET
I'm trying to do mass inserts/updates. Using Transactions. The table hierarchy contains 3 levels (TL1, TL2, and TL3): Here is what I'm trying to accomplish:
1) Start Begin Transaction (in desperation, I've tried all the isolation levels- I was hoping ReadUncommitted would work!) 2) Do an Insert/Update in table TL1 (this works). 3) Grab the ID from step 2 and do a SELECT on table TL2 to determine if I need to an UPDATE or INSERT.
Since I'd be inserting 3 rows into table TL2 (for a particular parent ID with different types), the first SELECT (on TL2) works and then I'm able to do an INSERT into TL2. The transaction is still alive. Now, I try to do a SELECT on table TL2 to see if a record exists for this type and this is when I get the exception "Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding."
My guess is that I have a LOCK on the table TL2 (from the first SELECT), which seems to be causing the problem.
Note: The INSERTs and UPDATEs are done by executing stored procs. For the SELECTS, I'm using a different connection (from the one which the transaction is using) and close it after the SELECT is executed.
I'm not sure I understand what you mean by "Even faster, consider using XML
for ..."
Could you clarify it?
Thanks,
José
"Cowboy (Gregory A. Beamer)" <No************ @comcast.netNoS pamM> a écrit
dans le message de news:u%******** ********@TK2MSF TNGP10.phx.gbl. .. Consider running all of the statements in a single stored procedure and
let SQL Server handle the transaction rather than roundtrip. You can also set the CommandTimeout on the Command object(s), ConnectionTimeo ut on the Connection object.
Even faster, consider using XML for your INSERTS, UPDATES and cascaded DELETEs.
-- Gregory A. Beamer MVP; MCP: +I, SE, SD, DBA
*************** *************** *************** *************** ********** Think Outside the Box! *************** *************** *************** *************** ********** "Manoj K" <ma************ *@yahoo.com> wrote in message news:01******** *************** *****@phx.gbl.. . Environment:- Framework 1.1 DB: SQL Server 2000 (SQL Provider) OS: Windows 2000 Language: VB.NET
I'm trying to do mass inserts/updates. Using Transactions. The table hierarchy contains 3 levels (TL1, TL2, and TL3): Here is what I'm trying to accomplish:
1) Start Begin Transaction (in desperation, I've tried all the isolation levels- I was hoping ReadUncommitted would work!) 2) Do an Insert/Update in table TL1 (this works). 3) Grab the ID from step 2 and do a SELECT on table TL2 to determine if I need to an UPDATE or INSERT.
Since I'd be inserting 3 rows into table TL2 (for a particular parent ID with different types), the first SELECT (on TL2) works and then I'm able to do an INSERT into TL2. The transaction is still alive. Now, I try to do a SELECT on table TL2 to see if a record exists for this type and this is when I get the exception "Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding."
My guess is that I have a LOCK on the table TL2 (from the first SELECT), which seems to be causing the problem.
Note: The INSERTs and UPDATEs are done by executing stored procs. For the SELECTS, I'm using a different connection (from the one which the transaction is using) and close it after the SELECT is executed.
Gregory,
I think the transaction seems to be working fine because
it is doing the ROLLBACK. I still think it is the LOCK
that is causing the problem. Any ideas? -----Original Message----- Consider running all of the statements in a single stored
procedure and letSQL Server handle the transaction rather than roundtrip.
You can also setthe CommandTimeout on the Command object(s),
ConnectionTimeo ut on theConnection object.
Even faster, consider using XML for your INSERTS, UPDATES
and cascadedDELETEs.
-- Gregory A. Beamer MVP; MCP: +I, SE, SD, DBA
************** *************** *************** **************
************Think Outside the Box! ************** *************** *************** **************
************"Manoj K" <ma************ *@yahoo.com> wrote in message news:01******* *************** ******@phx.gbl. .. Environment:- Framework 1.1 DB: SQL Server 2000 (SQL Provider) OS: Windows 2000 Language: VB.NET
I'm trying to do mass inserts/updates. Using
Transactions. The table hierarchy contains 3 levels (TL1, TL2, and
TL3): Here is what I'm trying to accomplish:
1) Start Begin Transaction (in desperation, I've tried
all the isolation levels- I was hoping ReadUncommitted would work!) 2) Do an Insert/Update in table TL1 (this works). 3) Grab the ID from step 2 and do a SELECT on table TL2
to determine if I need to an UPDATE or INSERT.
Since I'd be inserting 3 rows into table TL2 (for a particular parent ID with different types), the first SELECT (on TL2) works and then I'm able to do an INSERT into TL2. The transaction is still alive. Now, I try to
do a SELECT on table TL2 to see if a record exists for this type and this is when I get the exception "Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding."
My guess is that I have a LOCK on the table TL2 (from
the first SELECT), which seems to be causing the problem.
Note: The INSERTs and UPDATEs are done by executing stored
procs. For the SELECTS, I'm using a different connection (from the one which the transaction is using) and close it
after the SELECT is executed.
.
Hi,
"SELECT (on TL2) works and then I'm able to do an INSERT
into TL2."
I think what is happening is that once the insert occurs, your future
selects are locked.
Maybe you could change your transaction level, from Table to Rows.
Hope this helps.
--
Glen Jones MCSD
"Manoj K" <ma************ *@yahoo.com> wrote in message
news:01******** *************** *****@phx.gbl.. . Environment:- Framework 1.1 DB: SQL Server 2000 (SQL Provider) OS: Windows 2000 Language: VB.NET
I'm trying to do mass inserts/updates. Using Transactions. The table hierarchy contains 3 levels (TL1, TL2, and TL3): Here is what I'm trying to accomplish:
1) Start Begin Transaction (in desperation, I've tried all the isolation levels- I was hoping ReadUncommitted would work!) 2) Do an Insert/Update in table TL1 (this works). 3) Grab the ID from step 2 and do a SELECT on table TL2 to determine if I need to an UPDATE or INSERT.
Since I'd be inserting 3 rows into table TL2 (for a particular parent ID with different types), the first SELECT (on TL2) works and then I'm able to do an INSERT into TL2. The transaction is still alive. Now, I try to do a SELECT on table TL2 to see if a record exists for this type and this is when I get the exception "Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding."
My guess is that I have a LOCK on the table TL2 (from the first SELECT), which seems to be causing the problem.
Note: The INSERTs and UPDATEs are done by executing stored procs. For the SELECTS, I'm using a different connection (from the one which the transaction is using) and close it after the SELECT is executed. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: J |
last post by:
How can I prevent the error of...
Timeout expired. The timeout period elapsed prior to completion of the
operation or the server is not responding.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Timeout expired. The
timeout period...
|
by: Jason |
last post by:
Hi all
I get the following error when executing a rather intense stored procedure
from an ASPX page.
I have tried:
- Increasing timeouts on IIS 5.0 (all areas that even mention timeout)
- use the "Connection Timeout=2400" string in the SqlConnection connections
string
- disabled connection pooling.
|
by: Chris Langston |
last post by:
I have a Web Server running IIS 5 or 6 on Windows 2K and Windows 2003 Server
that is experiencing strange shutdown problems. We are using ASP.NET v1.1
and our application is written in VB.NET
Here's the scenario:
1. .NET Windows Client on a remote machine makes a web service call to
update tables on a Web Server running SQL Server 2000.
2. The Update is updating about 1000 - 3000 records doing simple update
statements like "Update...
|
by: Nils Magnus Englund |
last post by:
Hi,
I've made a HttpModule which deals with user authentication. On the first
request in a users session, it fetches data from a SQL Server using the
following code:
using (SqlConnection connection = new
SqlConnection(ConfigurationSettings.AppSettings))
{
|
by: Nils Magnus Englund |
last post by:
Hi,
I've made a HttpModule which deals with user authentication. On the first
request in a users session, it fetches data from a SQL Server using the
following code:
using (SqlConnection connection = new
SqlConnection(ConfigurationSettings.AppSettings))
{
| |
by: VB Programmer |
last post by:
When I run my ASP.NET 2.0 web app on my dev machine it works perfect. When
I precomile it to my web deployment project and then copy the debug files to
my web server I get this problem when trying to login (obviously it's using
ASPNETDB.mdf). Any ideas?
Server Error in '/' Application.
--------------------------------------------------------------------------------
|
by: Ron |
last post by:
Hi,
I had a stored procedure on SQL 2000 server to run calculation with
large amount of data. When I called this stored procedure via
System.Data.SqlClient.SqlCommand on production, i got error as: (i
tried to run the stored procedure on query analyzer, and it works well)
Timeout expired. The timeout period elapsed prior to completion of the
operation or the server is not responding.
Description: An unhandled exception occurred...
|
by: dadocsis |
last post by:
I have a custom VB.net application that runs a query against an SQL
server that takes more than 3 minutes. Right now after 3 minutes it
times out. So far after doing my research I have changed the following:
in web.config:
<system.web>
<httpRuntime executionTimeout="1000" maxRequestLength="2000000"/>
<sessionState
mode="InProc"
|
by: Scorpion657 |
last post by:
Hey I really need help.
I have a Website coded using ASP.NET and VB and for some reason, i'm getting the following error when I try to upload or access a large file which is stored in the database. It was working fine when I was runing the site on the localhost. I added the following line to the web.config file to increase the timeout:
<httpRuntime
maxRequestLength="1048576"
executionTimeout="3600"/>
I also added: connection timeout =...
|
by: Andrew Cooper |
last post by:
Greetings,
I've got a website that has several pages with DataGrid controls on
them. The controls are bound to Object Datasources. On one of the
pages I keep getting a "Timeout expired. The timeout period elapsed
prior to completion of the operation or the server is not responding."
error. The data is being filled from a Stored Procedure on an SQL
Server. When I run the Stored Procedure on the actual server, it is
only taking 24...
|
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...
| |
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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...
|
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...
|
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();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |