sophia: make transaction log database-aware