     @client (err, client) =>
       return callback err if err
 
-      transaction = new Transaction client, @transaction
+      transaction = new Transaction client, @transaction, client.done
       transaction.start (err) =>
         return callback err if err
 

  #       query = 'SELECT * FROM Objects WHERE sha1 = $1'
  #       client.query query, [sha1], (err, result) ->
  #         console.log result.rows[0]
  #
  # @api private
  # @see pg.Client

    @client (err, client) ->
      return callback err if err
      client.query args..., callback
      client.done() unless @transaction

  # Runs queries within a nested transaction, rolling back on any error.
  #
