Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / February 2005

Tip: Looking for answers? Try searching our database.

Multi Threaded web Service

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Stu - 03 Feb 2005 10:37 GMT
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
Dilip Krishnan - 03 Feb 2005 13:38 GMT
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,
>
[quoted text clipped - 7 lines]
>
> Stu
Stu - 03 Feb 2005 14:09 GMT
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

> Hello Stu,
>     It should be... what are you trying to do and how is it failing (error
[quoted text clipped - 18 lines]
> >
> > Stu
Dilip Krishnan - 03 Feb 2005 14:16 GMT
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,
>
[quoted text clipped - 34 lines]
>>> TIA
>>> Stu
Stu - 03 Feb 2005 15:41 GMT
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

> Hello Stu,
>     Every request is in its own thread/context, so making batch calls should
[quoted text clipped - 47 lines]
> >>> TIA
> >>> Stu
Stu - 03 Feb 2005 15:57 GMT
Hi Dilip,

Could be something to do with that the
calculator is using a class which has shared properties on it ?

> Hi Dilip
> The thing is it works as a com+ component
[quoted text clipped - 57 lines]
> > >>> TIA
> > >>> Stu
Dilip Krishnan - 03 Feb 2005 23:03 GMT
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
[quoted text clipped - 57 lines]
>>>>> TIA
>>>>> Stu
Stu - 04 Feb 2005 09:05 GMT
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

> Hello Stu,
>     You're absolutely right. there is a problem in the com+ component and
[quoted text clipped - 68 lines]
> >>>>> TIA
> >>>>> Stu
Dilip Krishnan - 04 Feb 2005 13:26 GMT
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
[quoted text clipped - 71 lines]
>>>>>>> TIA
>>>>>>> Stu
Stu - 14 Feb 2005 20:31 GMT
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

> Hello Stu,
>    Oh sure that would certainly cause the problem! Any static class needs
[quoted text clipped - 82 lines]
> >>>>>>> TIA
> >>>>>>> Stu

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.