ADO Connection thread-sharing in MTS DLL

Hi,

I've got an MTS DLL called from various ASP pages with numerous methods in it, all of which could use one connection.

I'd originally declared the TADOconnection as a global var in the DLL. There was one method in the DLL to open the connection. Any other method I called within the DLL used the connection, and then closed it.

This caused failures as the DLL was being called from various threads in that one process would close the connection as another process was about to use it.

I converted this in a rush, so that each method independently opened the connection, used it, and closed it. This works, no failures, oodles of users and no problems, BUT, it's seriously slow compared to sharing the connection across threads as i was originally doing.

What should I be doing in order to give decent performance yet guarding against thread-problems?

I've thought of just opening the connection and leaving it open, allowing MTS to close it when the instance of the object closes, but I don't know if his would have any disastrous side-effects and I suspect it might.

Cheers,
Keith.(remove the SPAMFREE for my email address)