made nested transactions use the same DB copy (to ensure that after-transaction hooks get saved properly until the transaction is done). renamed url to uri.