Confirmed - W3TC is overwriting db.php when database caching is enabled and deleting db.php when database caching is disabled. I found a solution that seems to work, here:
http://wordpress.org/support/topic/newest-versions-of-w3tc-force-delete-dbphp?replies=4