The
following applies to MFC 4.x only - and even there not all
versions. In order to avoid problems with MFC, always be
sure to use the latest releases. At the time of this
writing this means VC++ 5.0 at least (there is an SP 3
out for this product!)
Internet server extensions and
filters need to be threadsafe. Please note that MFC's
CRecordSet class is not threadsafe. Your extension might
run some time (especially if you have set synchronous
mode), but it surely will crash both itself and IIS as
soon as there is sufficient workload.
This problem persists at least up
to version 4.10 of VC++ (have a look at the readme
sections in the info viewer - it's displayed there quite
prominently). It has been reported to us that VC++ 4.20
will have this fixed. We could not confirm this ourselfs
as we currently do not have this version available.
A proper alternative is to use the
native ODBC API. In this case its totally up to your
application to handle threadsafe coding. Please note that
native ODBC doesn't mean a large burden for specialised
applications (which probably your extension will be).
Please be reminded that - even with
the threadsafe MFC classes or native ODBC calls - the
ODBC dirver itselfs needs to be threadsafe. This isn't
the case for many single-tier drivers like dBase or MS
Access. We prefer SQL server, which was specifically
designed for multithreaded environments and is a sure
bet.
Credits to Bill Crowell
(Bill_Crowell@STERCOMM.COM) who brought this issue first
to our attention.
|