I am converting a project from VB6 to VB.NET which has hundreds of plug-in
DLLs that perform various tasks on the application database. In order to
allow us to use the .NET version of the application without first having to
convert all of the plug-ins, I am planning to allow the application to call
into the existing COM plug-in DLLs.
The DLLs expect an ADO (classic) connection to be provided to them before
their main method is called so that they can read and write the database.
When calling, the main application begins a transaction, calls into the DLL,
then makes some database updates itself and commits the transaction. If
anything goes wrong the transaction can be rolled back and everything is
undone.
The VB.NET version of the application is using ADO.NET to access the
database. I'm therefore unable to pass the application's connection to the
COM plug-ins as they won't recognise it. I am planning to open a second
connection using ADO classic and pass this to the plug-ins.
However, this means that I cannot put a single transaction around the
updates performed by both the application and the plug-in (as each is a
separate connection). If one should fail after the other has been committed,
I have lots the integrity of my data.
Can anyone suggest any approaches to dealing with this situation to minimise
(or hopefully eliminate) this problem?
Many thanks,
--
(O) e n o n e