473,385 Members | 1,890 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,385 software developers and data experts.

Multi Threaded web Service

Stu
Hi,

I have a web service that does database access and calculations
However it keeps falling over becuase its not multi threaded and each call to
it is not in its own space!!
I dont want to use com+ so is there any way of making it
Multi threaded

TIA

Stu
Nov 23 '05 #1
9 6072
Hello Stu,
It should be... what are you trying to do and how is it failing (error
message)

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Hi,

I have a web service that does database access and calculations
However it keeps falling over becuase its not multi threaded and each
call to
it is not in its own space!!
I dont want to use com+ so is there any way of making it
Multi threaded
TIA

Stu

Nov 23 '05 #2
Stu
Hi,

Its a calculator imagine it as a black box.
It grabs data then shoves everything into structures then process
and then writes back to the database

When Its called from a batch process to process thousands of clients
And then u call it from a web front end whilst its running you get
index out of bound errors

When the web service is called
I assumed that the structures defined etc are for each call ?
ie protected in its own apartment and hence thats why I asked the question

it works fine as a com+ component but want to move it away from there
without just wrapping a web service around the com+.ie pure web service

"Dilip Krishnan" wrote:
Hello Stu,
It should be... what are you trying to do and how is it failing (error
message)

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Hi,

I have a web service that does database access and calculations
However it keeps falling over becuase its not multi threaded and each
call to
it is not in its own space!!
I dont want to use com+ so is there any way of making it
Multi threaded
TIA

Stu


Nov 23 '05 #3
Hello Stu,
Every request is in its own thread/context, so making batch calls should
not interfere with your application. It could be you're running out of memory
or your aspnet wp is recycling because of the load or there is always this
possiblity :).... Could it be a problem with the logic?

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Hi,

Its a calculator imagine it as a black box.
It grabs data then shoves everything into structures then process
and then writes back to the database
When Its called from a batch process to process thousands of clients
And then u call it from a web front end whilst its running you get
index out of bound errors

When the web service is called
I assumed that the structures defined etc are for each call ?
ie protected in its own apartment and hence thats why I asked the
question
it works fine as a com+ component but want to move it away from there
without just wrapping a web service around the com+.ie pure web
service

"Dilip Krishnan" wrote:
Hello Stu,
It should be... what are you trying to do and how is it failing
(error
message)
HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Hi,

I have a web service that does database access and calculations
However it keeps falling over becuase its not multi threaded and
each
call to
it is not in its own space!!
I dont want to use com+ so is there any way of making it
Multi threaded
TIA
Stu

Nov 23 '05 #4
Stu
Hi Dilip
The thing is it works as a com+ component

All ive done is call the same com+ call eg calcMyData(customer)
but exposed it as a web service and have made the whole thing a webservice

Its definatley something to do with appartments or variables
becuase if i kick the web service off on multiple threads from a test
program I get the same error
"Dilip Krishnan" wrote:
Hello Stu,
Every request is in its own thread/context, so making batch calls should
not interfere with your application. It could be you're running out of memory
or your aspnet wp is recycling because of the load or there is always this
possiblity :).... Could it be a problem with the logic?

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Hi,

Its a calculator imagine it as a black box.
It grabs data then shoves everything into structures then process
and then writes back to the database
When Its called from a batch process to process thousands of clients
And then u call it from a web front end whilst its running you get
index out of bound errors

When the web service is called
I assumed that the structures defined etc are for each call ?
ie protected in its own apartment and hence thats why I asked the
question
it works fine as a com+ component but want to move it away from there
without just wrapping a web service around the com+.ie pure web
service

"Dilip Krishnan" wrote:
Hello Stu,
It should be... what are you trying to do and how is it failing
(error
message)
HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Hi,

I have a web service that does database access and calculations
However it keeps falling over becuase its not multi threaded and
each
call to
it is not in its own space!!
I dont want to use com+ so is there any way of making it
Multi threaded
TIA
Stu


Nov 23 '05 #5
Stu
Hi Dilip,

Could be something to do with that the
calculator is using a class which has shared properties on it ?
"Stu" wrote:
Hi Dilip
The thing is it works as a com+ component

All ive done is call the same com+ call eg calcMyData(customer)
but exposed it as a web service and have made the whole thing a webservice

Its definatley something to do with appartments or variables
becuase if i kick the web service off on multiple threads from a test
program I get the same error
"Dilip Krishnan" wrote:
Hello Stu,
Every request is in its own thread/context, so making batch calls should
not interfere with your application. It could be you're running out of memory
or your aspnet wp is recycling because of the load or there is always this
possiblity :).... Could it be a problem with the logic?

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Hi,

Its a calculator imagine it as a black box.
It grabs data then shoves everything into structures then process
and then writes back to the database
When Its called from a batch process to process thousands of clients
And then u call it from a web front end whilst its running you get
index out of bound errors

When the web service is called
I assumed that the structures defined etc are for each call ?
ie protected in its own apartment and hence thats why I asked the
question
it works fine as a com+ component but want to move it away from there
without just wrapping a web service around the com+.ie pure web
service

"Dilip Krishnan" wrote:

> Hello Stu,
> It should be... what are you trying to do and how is it failing
> (error
> message)
> HTH
> Regards,
> Dilip Krishnan
> MCAD, MCSD.net
> dkrishnan at geniant dot com
> http://www.geniant.com
>> Hi,
>>
>> I have a web service that does database access and calculations
>> However it keeps falling over becuase its not multi threaded and
>> each
>> call to
>> it is not in its own space!!
>> I dont want to use com+ so is there any way of making it
>> Multi threaded
>> TIA
>> Stu
>>


Nov 23 '05 #6
Hello Stu,
You're absolutely right. there is a problem in the com+ component and
the way its being used by ASP.net.

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Hi Dilip
The thing is it works as a com+ component
All ive done is call the same com+ call eg calcMyData(customer) but
exposed it as a web service and have made the whole thing a webservice

Its definatley something to do with appartments or variables
becuase if i kick the web service off on multiple threads from a test
program I get the same error
"Dilip Krishnan" wrote:
Hello Stu,
Every request is in its own thread/context, so making batch calls
should
not interfere with your application. It could be you're running out
of memory
or your aspnet wp is recycling because of the load or there is always
this
possiblity :).... Could it be a problem with the logic?
HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Hi,

Its a calculator imagine it as a black box.
It grabs data then shoves everything into structures then process
and then writes back to the database
When Its called from a batch process to process thousands of clients
And then u call it from a web front end whilst its running you get
index out of bound errors
When the web service is called
I assumed that the structures defined etc are for each call ?
ie protected in its own apartment and hence thats why I asked the
question
it works fine as a com+ component but want to move it away from
there
without just wrapping a web service around the com+.ie pure web
service
"Dilip Krishnan" wrote:

Hello Stu,
It should be... what are you trying to do and how is it failing
(error
message)
HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
> Hi,
>
> I have a web service that does database access and calculations
> However it keeps falling over becuase its not multi threaded and
> each
> call to
> it is not in its own space!!
> I dont want to use com+ so is there any way of making it
> Multi threaded
> TIA
> Stu


Nov 23 '05 #7
Stu
Hi Dilip
So if I remove the static class it will fix the problem
Its not a com+ component any more its a pure web service
"Dilip Krishnan" wrote:
Hello Stu,
You're absolutely right. there is a problem in the com+ component and
the way its being used by ASP.net.

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Hi Dilip
The thing is it works as a com+ component
All ive done is call the same com+ call eg calcMyData(customer) but
exposed it as a web service and have made the whole thing a webservice

Its definatley something to do with appartments or variables
becuase if i kick the web service off on multiple threads from a test
program I get the same error
"Dilip Krishnan" wrote:
Hello Stu,
Every request is in its own thread/context, so making batch calls
should
not interfere with your application. It could be you're running out
of memory
or your aspnet wp is recycling because of the load or there is always
this
possiblity :).... Could it be a problem with the logic?
HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Hi,

Its a calculator imagine it as a black box.
It grabs data then shoves everything into structures then process
and then writes back to the database
When Its called from a batch process to process thousands of clients
And then u call it from a web front end whilst its running you get
index out of bound errors
When the web service is called
I assumed that the structures defined etc are for each call ?
ie protected in its own apartment and hence thats why I asked the
question
it works fine as a com+ component but want to move it away from
there
without just wrapping a web service around the com+.ie pure web
service
"Dilip Krishnan" wrote:

> Hello Stu,
> It should be... what are you trying to do and how is it failing
> (error
> message)
> HTH
> Regards,
> Dilip Krishnan
> MCAD, MCSD.net
> dkrishnan at geniant dot com
> http://www.geniant.com
>> Hi,
>>
>> I have a web service that does database access and calculations
>> However it keeps falling over becuase its not multi threaded and
>> each
>> call to
>> it is not in its own space!!
>> I dont want to use com+ so is there any way of making it
>> Multi threaded
>> TIA
>> Stu


Nov 23 '05 #8
Hello Stu,
Oh sure that would certainly cause the problem! Any static class needs
to be thread safe

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Hi Dilip
So if I remove the static class it will fix the problem
Its not a com+ component any more its a pure web service
"Dilip Krishnan" wrote:
Hello Stu,
You're absolutely right. there is a problem in the com+ component and
the way its being used by ASP.net.
HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Hi Dilip
The thing is it works as a com+ component
All ive done is call the same com+ call eg calcMyData(customer) but
exposed it as a web service and have made the whole thing a
webservice
Its definatley something to do with appartments or variables
becuase if i kick the web service off on multiple threads from a
test
program I get the same error
"Dilip Krishnan" wrote:
Hello Stu,
Every request is in its own thread/context, so making batch calls
should
not interfere with your application. It could be you're running out
of memory
or your aspnet wp is recycling because of the load or there is
always
this
possiblity :).... Could it be a problem with the logic?
HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
> Hi,
>
> Its a calculator imagine it as a black box.
> It grabs data then shoves everything into structures then process
> and then writes back to the database
> When Its called from a batch process to process thousands of
> clients
> And then u call it from a web front end whilst its running you get
> index out of bound errors
> When the web service is called
> I assumed that the structures defined etc are for each call ?
> ie protected in its own apartment and hence thats why I asked the
> question
> it works fine as a com+ component but want to move it away from
> there
> without just wrapping a web service around the com+.ie pure web
> service
> "Dilip Krishnan" wrote:
>> Hello Stu,
>> It should be... what are you trying to do and how is it failing
>> (error
>> message)
>> HTH
>> Regards,
>> Dilip Krishnan
>> MCAD, MCSD.net
>> dkrishnan at geniant dot com
>> http://www.geniant.com
>>> Hi,
>>>
>>> I have a web service that does database access and calculations
>>> However it keeps falling over becuase its not multi threaded and
>>> each
>>> call to
>>> it is not in its own space!!
>>> I dont want to use com+ so is there any way of making it
>>> Multi threaded
>>> TIA
>>> Stu


Nov 23 '05 #9
Stu
Hi,

Ive removed the static problem now took me ages.
So heres a summary

i have a dot net webservice in vb dot net say
objcalc.calculate(customerId)
I know that web services are multi threaded but how do I ensure
my webservice can handle mutliple synchronous requests the web service
doesnt not need to be asynchronous.

Do I need to synchlock my parameter passed into the web service ?
What about thread pooling etc ?

Most samples seem to show how you kick off which I understand
But not in the webservice itself so Any code for this would be appreciated

"Dilip Krishnan" wrote:
Hello Stu,
Oh sure that would certainly cause the problem! Any static class needs
to be thread safe

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Hi Dilip
So if I remove the static class it will fix the problem
Its not a com+ component any more its a pure web service
"Dilip Krishnan" wrote:
Hello Stu,
You're absolutely right. there is a problem in the com+ component and
the way its being used by ASP.net.
HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Hi Dilip
The thing is it works as a com+ component
All ive done is call the same com+ call eg calcMyData(customer) but
exposed it as a web service and have made the whole thing a
webservice
Its definatley something to do with appartments or variables
becuase if i kick the web service off on multiple threads from a
test
program I get the same error
"Dilip Krishnan" wrote:
> Hello Stu,
> Every request is in its own thread/context, so making batch calls
> should
> not interfere with your application. It could be you're running out
> of memory
> or your aspnet wp is recycling because of the load or there is
> always
> this
> possiblity :).... Could it be a problem with the logic?
> HTH
> Regards,
> Dilip Krishnan
> MCAD, MCSD.net
> dkrishnan at geniant dot com
> http://www.geniant.com
>> Hi,
>>
>> Its a calculator imagine it as a black box.
>> It grabs data then shoves everything into structures then process
>> and then writes back to the database
>> When Its called from a batch process to process thousands of
>> clients
>> And then u call it from a web front end whilst its running you get
>> index out of bound errors
>> When the web service is called
>> I assumed that the structures defined etc are for each call ?
>> ie protected in its own apartment and hence thats why I asked the
>> question
>> it works fine as a com+ component but want to move it away from
>> there
>> without just wrapping a web service around the com+.ie pure web
>> service
>> "Dilip Krishnan" wrote:
>>> Hello Stu,
>>> It should be... what are you trying to do and how is it failing
>>> (error
>>> message)
>>> HTH
>>> Regards,
>>> Dilip Krishnan
>>> MCAD, MCSD.net
>>> dkrishnan at geniant dot com
>>> http://www.geniant.com
>>>> Hi,
>>>>
>>>> I have a web service that does database access and calculations
>>>> However it keeps falling over becuase its not multi threaded and
>>>> each
>>>> call to
>>>> it is not in its own space!!
>>>> I dont want to use com+ so is there any way of making it
>>>> Multi threaded
>>>> TIA
>>>> Stu


Nov 23 '05 #10

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

Similar topics

0
by: Ganbold | last post by:
Hi, I'm new to multi-threaded programming and reading the book "Programming with POSIX Threads" and trying to understand concepts and coding. What I'm trying to do is to rewrite mysql client...
5
by: Rob Durant | last post by:
Hi, I have a multi-threaded application (have also tried as service - same behaviour) that runs fine on XP, but not on 2003. Symptoms are: Threads are started normally, locks acquired and...
2
by: Robert May | last post by:
I have a windows service that spawns multiple threads running a thing that does a bunch of processing. Here's the code that spawns the threads: ...
1
by: Mullin Yu | last post by:
As subject. I have lots of VB6 dll and ocx files and they are single-threaded as VB6 doesn't support multi-threaded indeed. Can I wrap anything at .NET so that multi-threaded feature can be...
0
by: BergRD | last post by:
Salutations! New to the forums but have gotten many an idea from lurking over the past few months but alas it's time to begin positing; posting to a problem I cannot seem to resolve. This is a...
0
by: BergRD | last post by:
For some odd reason my original post was double posted then removed from the forums. Odd happenings but wanted to re-post incase no one saw the original, thanks :D > Salutations! > > New to...
0
by: Stu | last post by:
Hi, i have a dot net webservice in vb dot net say objcalc.calculate(customerId) I know that web services are multi threaded but how do I ensure my webservice can handle mutliple synchronous...
5
by: Macca | last post by:
Hi, I have a multithreaded app which now needs database storage. I am in the process of designing my Data Access Layer but and was wondering what issues I should look for for in regards to a...
14
by: =?ISO-8859-1?Q?Tom=E1s_=D3_h=C9ilidhe?= | last post by:
As far as I know, the C Standard has no mention of multi-threaded programming; it has no mention of how to achieve multi-threaded programming, nor does it mention whether the language or its...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
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
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
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...

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.