We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

multiple instance accessing webservices giving error

x1877
x1877 asked
on
Medium Priority
172 Views
Last Modified: 2010-04-24
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


Comment
Watch Question

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.

Author

Commented:
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.

Author

Commented:
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.

So, if you want it like that, open/close your database in your webservice method

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
i made the connection object private
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.