title: Upgrading capybara from 1.0.1 to 1.1.4 makes database_cleaner break my specs
body: <p>I have an old Rails application upgraded to version 3.2.11 that has a lot of request specifications written using capybara version 1.0.1 and running using the selenium driver. The database are cleaned after each test using database_cleaner using the truncation strategy.</p>
  
  <p>I want to use poltergeist instead of selenium and upgraded capybara from 1.0.1 to 1.1.4 to be able to use the latest version of poltergeist. Only changing the capybara gem (and its dependencies) introduced problems running my specs. </p>
  
  <p>I consistently get deadlock errors from my Postgresql database in the cleanup handler after each spec. My spec_helper is pretty basic and looks like this:</p>
  
  <pre><code>RSpec.configure do |config|
    config.mock_with :rspec
  
    config.use_transactional_fixtures = false
  
    config.before(:suite) do
      DatabaseCleaner.strategy = :truncation
      DatabaseCleaner.clean_with(:truncation)
    end
  
    config.before(:each) do
      DatabaseCleaner.start
    end
  
    config.after(:each) do
      DatabaseCleaner.clean
    end
  end
  </code></pre>
  
  <p>The error I get is like this:</p>
  
  <pre><code>An error occurred in an after hook
    ActiveRecord::StatementInvalid: PG::Error: ERROR:  deadlock detected
  DETAIL:  Process 41747 waits for AccessExclusiveLock on relation 17612 of database 16396; blocked by process 41752.
  Process 41752 waits for RowExclusiveLock on relation 17529 of database 16396; blocked by process 41747.
  HINT:  See server log for query details.
  : ALTER TABLE "aaa" ENABLE TRIGGER ALL;ALTER TABLE "bbbb" ENABLE TRIGGER ALL;ALTER TABLE "ccc" ENABLE TRIGGER ALL;
    occurred at /xxx/.bundle/gems/activerecord-3.2.11/lib/active_record/connection_adapters/postgresql_adapter.rb:652:in `async_exec'
  </code></pre>
  
  <p>I use FactoryGirl to create test data but otherwise nothing special IMO.</p>
  
  <p>I haven't been able to figure out what holds the other end of deadlock that is created by database_cleaner. Any ideas to figure that out are most welcome.</p>
  
  <p>Anybody know of any changes between capybara 1.0.1 and 1.1.4 that has changed and may have started to cause these issues? </p>