CFTRANSACTION with multiple datasources
I am writing a data migration utility that pulls data from a temp database, located in a DMZ, through the firewall and stores the data in the production database inside the firewall. Because of the firewall the data is stored on two different databases and as a result I need to use two different datasources (DSNs) to talk to them. After each record is wrote to the production database I would like to set a flag in the DMZ database showing the record has been processed. This works fine 99% of the time… but…
Because I am using two different DSNs every now and then the “set the completed flag” write process fails. When this happens I get duplicated records in the production database. What I would like to do is wrap the entire process inside a CFTRANSACTION.
These are the steps I would like encapsulate inside the CFTRANSACTION tag:
<CFTRANSACTION>
<CFQUERY name=”GetTmpData” datasource=”DSN_DMZ”>Read Data</CFQUERY>
<CFQUERY name=”WriteProdData” datasource=”DSN_PROD”>Write Data</CFQUERY>
<CFQUERY name=”SetFlag” datasource=”DSN_DMZ”>Set Flag</CFQUERY>
</CFTRANSACTION>
Any thoughts on how to accomplish this???
Thanks in Advance for Any and All Help!!!
Kurtis ~|:-)
