ColdFusion pools connections. There are timeout settings on the connections.
You have to have ZERO ACTIVITY on the connection pool before it lets the lock
go.

Set an application variable to lock out your app, and wait for the pooled
connection to timeout. I think the default's somewhere in the 1-5 minute range.

Obviously you're not going to be able to FTP over your database while your app
is active. You may want to investigate alternatives to a wholesale overwrite.
Your having to do this makes the application design suspect.