Link to home
Create AccountLog in
Avatar of x1877
x1877Flag for United States of America

asked on

multiple instance accessing webservices giving error

i have a  vb.net application which is having a reference to a webservices which also i made.
its working fine.
but when i run multiple instance from different machines at same time it strats giving errors like this

"There is already an open datareader associated with this connection , which must be closed."

i dont understand why this is happending , according to my knowledge both should run as independent threads
How can i solve this issue?

Thanks


Avatar of PockyMaster
PockyMaster
Flag of Netherlands image

1 single opened connection can have just 1 open datareader. If you are to serve multiple readers you are needing multiple connections, or use a different approach.
Avatar of x1877

ASKER

how can i do this ? on webservice server its only having one connection object . how can i force it to take multiple instance of the connection object in case it is called from different instance?
I assume your connection object is located in your webservice.
You might try to keep your connection alive when needed often.
You might protect being called multiple times with mutexes, but I've never tried them in a webservice. Or you might create a connectionpool and use another connection, in case you're busy.
Avatar of x1877

ASKER

what i want is each time this webservice method is called from different instance of client application, it should create entirly different connection objects, so that the threds will work with out problems. when its running alone the application is running fine.

ASKER CERTIFIED SOLUTION
Avatar of PockyMaster
PockyMaster
Flag of Netherlands image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of x1877

ASKER

i made the connection object private