473,406 Members | 2,352 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,406 software developers and data experts.

Stored procedure and threading help.

Hi all,

i am having application which is using stored procedure written in sql
server.
I want to develop multithreaded applicaton.
The store procedure is returing list of rows of table.
what i want to ask is, if i tried to call same stored procedure in
different thread , is it possible or it will created problem in
multithreaded application.

If yes how to get rows returing from stored procedure.

Any help will be appreciated.
thanks in advance.

Nov 17 '05 #1
2 3036
It should not cause a problem as long as you are not trying to relate the
different data pulls. If you are doing this

Spawn thread
Call for user information

Spawn another thread
Call for user orders

Spawn another thread
Call for user order details

When all are returned, relate them

That could be problematic as there is no locking mechanism across all calls,
which means data could be updated rendering user or orderinformation invalid
when you call for details.

If you are pulling data asynch that is not related, you should not have any
problems. Looking at your post, it appears you are simply calling the same
stored procedure on multiple threads (for multiple users?).

Short answer: As long as the threads are not talking to each other (or
aggregating for the main app thread to relate data), you should not have any
problems.
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
"tr**************@yahoo.com" wrote:
Hi all,

i am having application which is using stored procedure written in sql
server.
I want to develop multithreaded applicaton.
The store procedure is returing list of rows of table.
what i want to ask is, if i tried to call same stored procedure in
different thread , is it possible or it will created problem in
multithreaded application.

If yes how to get rows returing from stored procedure.

Any help will be appreciated.
thanks in advance.

Nov 17 '05 #2
Hi,
There is no difference at all, just create the thread with method you use
to execute the SP, note that you cannot pass a parameter ( but there r ways
of doing it ) then this method will become the new thread.
Do your stuff and if you store the readed data in a instance variable it
will be available from the originator thread. just notice that you need to
control that nobody access the collection at the same time you are
populating it.

There is nothing really difficult about it.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

<tr**************@yahoo.com> wrote in message
news:11*********************@g43g2000cwa.googlegro ups.com...
Hi all,

i am having application which is using stored procedure written in sql
server.
I want to develop multithreaded applicaton.
The store procedure is returing list of rows of table.
what i want to ask is, if i tried to call same stored procedure in
different thread , is it possible or it will created problem in
multithreaded application.

If yes how to get rows returing from stored procedure.

Any help will be appreciated.
thanks in advance.

Nov 17 '05 #3

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

Similar topics

4
by: Michael Trosen | last post by:
Hi Everyone, I hope someone can help, I'm pretty new to pro*c programming. I have the following application setup: a pro*c program calls a stored procedure and recieves a cursor back: the...
3
by: dinesh prasad | last post by:
I'm trying to use a servlet to process a form, then send that data to an SQL server stored procedure. I'm using the WebLogic 8 App. server. I am able to retrieve database information, so I know my...
3
by: Jarrod Morrison | last post by:
Hi all Im relatively new to using stored procedures and im not sure if it is possible to do what I am trying to do so any help here is greatly appreciated. I am using the variable @MachineName...
4
by: Dan | last post by:
I've encountered some strange behavior in a recursive procedure I'm writing for a bill of materials. First let me ask directly if what I think is happening is even possible: It seems like the...
4
by: marc | last post by:
I've been developing a stored procedure that uses a user defined function in the query portion of the procedure. However, since the end product needs to allow for dynamic table names, the UDF will...
3
by: Rhino | last post by:
I've spent the last couple of hours trying to figure out how to debug a Java stored procedure and am just going in circles. The last straw came when I got "Cannot open input stream for default"...
7
by: Siv | last post by:
Hi, I have a stored procedure that I want to execute and then wait in a loop showing a timer whilst it completes and then carry on once I get notification that it has completed. The main reason...
4
by: nishi57 | last post by:
I hope I can get some help regarding this issue, which has been going on for a while. I have a desktop user who is having problem running "Stored Procedures". The DB2 Connect application works fine...
0
by: SOI_0152 | last post by:
Hi all! Happy New Year 2008. Il hope it will bring you love and happyness I'm new on this forum. I wrote a stored procedure on mainframe using DB2 7.1.1 and IBM language c. Everything works...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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
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...
0
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...
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
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...

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.