473,396 Members | 1,968 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

how do you handle multiple update request on the database?

Hi,

I was thinking of using MSMQ to handling multiple simultaneous
database request to update or insert records to table. There could be
hundreds of database existing connections trying to access the same
table. I was thinking to writing an app with threads to listen and 1
at a time handle each request on the queue.

Is this a good approach? If not, is there a better way with .NET/C#?

Is there a good link to view an example on how to do this?

Thanks

Mar 19 '07 #1
7 5236
This depends on the database that you are using. If it is SQL server,
then I would just set connection pooling on for your app, and then just make
the requests as they come in. SQL Server will handle the concurrency issues
(as far as updating the same tables at the same time, but not making sure
that changes don't overwrite each other, that's up to you).

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<Ab******@gmail.comwrote in message
news:11**********************@l77g2000hsb.googlegr oups.com...
Hi,

I was thinking of using MSMQ to handling multiple simultaneous
database request to update or insert records to table. There could be
hundreds of database existing connections trying to access the same
table. I was thinking to writing an app with threads to listen and 1
at a time handle each request on the queue.

Is this a good approach? If not, is there a better way with .NET/C#?

Is there a good link to view an example on how to do this?

Thanks

Mar 19 '07 #2
Actually, one more here -- transcation

http://www.codeproject.com/cs/database/transactions.asp

cheers,
RL
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote in
message news:Oi**************@TK2MSFTNGP02.phx.gbl...
This depends on the database that you are using. If it is SQL server,
then I would just set connection pooling on for your app, and then just
make the requests as they come in. SQL Server will handle the concurrency
issues (as far as updating the same tables at the same time, but not
making sure that changes don't overwrite each other, that's up to you).

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<Ab******@gmail.comwrote in message
news:11**********************@l77g2000hsb.googlegr oups.com...
>Hi,

I was thinking of using MSMQ to handling multiple simultaneous
database request to update or insert records to table. There could be
hundreds of database existing connections trying to access the same
table. I was thinking to writing an app with threads to listen and 1
at a time handle each request on the queue.

Is this a good approach? If not, is there a better way with .NET/C#?

Is there a good link to view an example on how to do this?

Thanks


Mar 19 '07 #3
Nicholas Paldino [.NET/C# MVP] wrote:
This depends on the database that you are using. If it is SQL server,
then I would just set connection pooling on for your app, and then just make
the requests as they come in. SQL Server will handle the concurrency issues
(as far as updating the same tables at the same time, but not making sure
that changes don't overwrite each other, that's up to you).
There are two aspects of the subject:
1) 2+ requests with 1 SQL statement each
2) 2+ requests with 2+ SQL statements each

#1 is handled fine by all databases I know about out of the box.

#2 is not not generally handled by any database I know of. Depending
on the SQL statements various solution exists (often involving
a high transaction isolation level).

I do not see SQLServer as being special.

Arne
Mar 19 '07 #4
I made the assumption that the OP was using an RDBMS like SQL Server,
but the statement applies for any RDBMS. It will handle multiple update
requests that come in at the same time to the server. Things such as
Access, FoxPro, Excel etc, etc, have to be handled differently, as they do
not scale well when hit with many requests at the same time (the
drivers/providers just aren't up for it).

If the OP was using Oracle, mySql, the same applies.

Any database will handle #2 fine. The OP wasn't clear about how he
wants sequential statements handled. If a database couldn't handle
sequential statements, then I would be pretty wary of it, wouldn't you?
He/she didn't mention if he wanted it in a transaction or not, but from the
original post, my impression was that the OP was concerned about the
database handling that many updates/requests at a time.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Arne Vajhøj" <ar**@vajhoej.dkwrote in message
news:45***********************@news.sunsite.dk...
Nicholas Paldino [.NET/C# MVP] wrote:
> This depends on the database that you are using. If it is SQL
server, then I would just set connection pooling on for your app, and
then just make the requests as they come in. SQL Server will handle the
concurrency issues (as far as updating the same tables at the same time,
but not making sure that changes don't overwrite each other, that's up to
you).

There are two aspects of the subject:
1) 2+ requests with 1 SQL statement each
2) 2+ requests with 2+ SQL statements each

#1 is handled fine by all databases I know about out of the box.

#2 is not not generally handled by any database I know of. Depending
on the SQL statements various solution exists (often involving
a high transaction isolation level).

I do not see SQLServer as being special.

Arne

Mar 19 '07 #5
Nicholas Paldino [.NET/C# MVP] wrote:
I made the assumption that the OP was using an RDBMS like SQL Server,
but the statement applies for any RDBMS. It will handle multiple update
requests that come in at the same time to the server. Things such as
Access,
Access should handle multiple updates fine. At least consistent.
Performance will not be good.
Any database will handle #2 fine. The OP wasn't clear about how he
wants sequential statements handled. If a database couldn't handle
sequential statements, then I would be pretty wary of it, wouldn't you?
??

It is basic knowledge that logic like:

x = SELECT MAX(id) FROM table
INSERT INTO table VALUES(x+1,'foobar')

is not generally safe.

Arne
Mar 19 '07 #6
Arne,

Try having more than 4-5 concurrent requests to an access database and
see what happens. It most definitely doesn't scale well.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Arne Vajhøj" <ar**@vajhoej.dkwrote in message
news:45***********************@news.sunsite.dk...
Nicholas Paldino [.NET/C# MVP] wrote:
> I made the assumption that the OP was using an RDBMS like SQL Server,
but the statement applies for any RDBMS. It will handle multiple update
requests that come in at the same time to the server. Things such as
Access,

Access should handle multiple updates fine. At least consistent.
Performance will not be good.
> Any database will handle #2 fine. The OP wasn't clear about how he
wants sequential statements handled. If a database couldn't handle
sequential statements, then I would be pretty wary of it, wouldn't you?

??

It is basic knowledge that logic like:

x = SELECT MAX(id) FROM table
INSERT INTO table VALUES(x+1,'foobar')

is not generally safe.

Arne

Mar 20 '07 #7
Nicholas Paldino [.NET/C# MVP] wrote:
Try having more than 4-5 concurrent requests to an access database and
see what happens. It most definitely doesn't scale well.
I believe you.

But poor performance is not the same as data corruption.

Arne
Mar 20 '07 #8

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

Similar topics

3
by: jason | last post by:
How does one loop through the contents of a form complicated by dynamic construction of checkboxes which are assigned a 'model' and 'listingID' to the NAME field on the fly in this syntax:...
2
by: Olivia Towery | last post by:
SQL 6.5 Database I have a list of registrants and I want to use a check box after each record to show those who attend and then post all with one submit button. Any help is appreciated. --...
0
by: Chris Hall | last post by:
The records in my database are displayed in a form as follows: %> <form action="report-ammend1.42.asp" method="post"name="form"> <table border=1> <% x = 1
7
by: Drew | last post by:
I have a db table like the following, UID, int auto-increment RegNo Person Relation YearsKnown Now here is some sample data from this table,
0
by: Tiro | last post by:
Hi, I am trying to understand how does .Net Web Service handle requests for multiple clients simultaneously. Here is what I am trying to achieve. I have created a web serive that search...
6
by: James Radke | last post by:
Hello, I have a multithreaded windows NT service application (vb.net 2003) that I am working on (my first one), which reads a message queue and creates multiple threads to perform the processing...
4
by: Jack | last post by:
Hi, I have a asp page where part of the code is as follows. This builds up the sql statement partially. sql01 = "UPDATE EquipmentTbl SET " sql01 = sql01 & "SerialNumber = '" &...
10
by: 60325 | last post by:
This is the page where I collect the data in drop-down boxes with values of 1-10 and send it to a submitted page to do calculations. Example: Employee1 TeamScore(1-10) Employee2 ...
10
by: pmarisole | last post by:
This is the first page...... <select size="1" name="Q1_<%=i%>" onChange="calc(<%=i%>)"> <option selected value="<% =rsScores("Q1") <option value="1">1</option> <option value="2">2</option>...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...
0
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,...

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.