Switching database connection between readonly one and writable one