diff --git a/core/core.services.yml b/core/core.services.yml
index 328acd8..3f150c6 100644
--- a/core/core.services.yml
+++ b/core/core.services.yml
@@ -39,7 +39,7 @@ services:
       - [setContainer, ['@service_container']]
   cache.backend.database:
     class: Drupal\Core\Cache\DatabaseBackendFactory
-    arguments: ['@database']
+    arguments: ['@database.secondary']
   cache.backend.apcu:
     class: Drupal\Core\Cache\ApcuBackendFactory
     arguments: ['@app.root']
@@ -172,6 +172,11 @@ services:
     factory_class: Drupal\Core\Database\Database
     factory_method: getConnection
     arguments: [default]
+  database.secondary:
+    class: Drupal\Core\Database\Connection
+    factory_class: Drupal\Core\Database\Database
+    factory_method: getConnection
+    arguments: [secondary]
   form_builder:
     class: Drupal\Core\Form\FormBuilder
     arguments: ['@form_validator', '@form_submitter', '@form_cache', '@module_handler', '@event_dispatcher', '@request_stack', '@class_resolver', '@theme.manager', '@?csrf_token']
@@ -246,7 +251,7 @@ services:
       - [setContainer, ['@service_container']]
   queue.database:
     class: Drupal\Core\Queue\QueueDatabaseFactory
-    arguments: ['@database']
+    arguments: ['@database.secondary']
   path.alias_whitelist:
     class: Drupal\Core\Path\AliasWhitelist
     tags:
@@ -468,12 +473,12 @@ services:
     parent: default_plugin_manager
   lock:
     class: Drupal\Core\Lock\DatabaseLockBackend
-    arguments: ['@database']
+    arguments: ['@database.secondary']
     tags:
       - { name: backend_overridable }
   lock.persistent:
     class: Drupal\Core\Lock\PersistentDatabaseLockBackend
-    arguments: ['@database']
+    arguments: ['@database.secondary']
   router.request_context:
     class: Drupal\Core\Routing\RequestContext
     tags:
diff --git a/core/modules/dblog/dblog.services.yml b/core/modules/dblog/dblog.services.yml
index 96ac2ee..99f8cf3 100644
--- a/core/modules/dblog/dblog.services.yml
+++ b/core/modules/dblog/dblog.services.yml
@@ -1,7 +1,7 @@
 services:
   logger.dblog:
     class: Drupal\dblog\Logger\DbLog
-    arguments: ['@database', '@logger.log_message_parser']
+    arguments: ['@database.secondary', '@logger.log_message_parser']
     tags:
       - { name: logger }
       - { name: backend_overridable }
diff --git a/core/modules/system/src/Tests/Database/TransactionTest.php b/core/modules/system/src/Tests/Database/TransactionTest.php
index 00ec458..fa15ab1 100644
--- a/core/modules/system/src/Tests/Database/TransactionTest.php
+++ b/core/modules/system/src/Tests/Database/TransactionTest.php
@@ -493,5 +493,45 @@ function testTransactionStacking() {
     $this->assertRowAbsent('inner');
     $this->assertRowAbsent('inner2');
   }
+
+  /**
+   * Test that different connections to not share a transaction.
+   */
+  public function testTransactionMultipleConnections() {
+    \Drupal::database()->truncate('test')->execute();
+    // Setup a secondary database connection.
+    $connection_info = Database::getConnectionInfo('default');
+    Database::addConnectionInfo('default', 'secondary', $connection_info['default']);
+
+    /** @var \Drupal\Core\Database\Connection $connection_default */
+    $connection_default = \Drupal::service('database');
+    /** @var \Drupal\Core\Database\Connection $connection_secondary */
+    $connection_secondary = \Drupal::service('database.secondary');
+    // Ensure that the new connection is a different one.
+    $this->assertNotEqual(spl_object_hash($connection_default), spl_object_hash($connection_secondary));
+
+    // Open up a transaction in the first connection, add an entry in a table.
+    // Ensure that it can be access in the first connection, but not access in
+    // the second database connection.
+    $transaction = $connection_default->startTransaction();
+    $connection_default
+      ->insert('test')
+      ->fields(['name' => 'Tim', 'age' => '30'])
+      ->execute();
+    $connection_default
+      ->insert('test')
+      ->fields(['name' => 'Damian', 'age' => '30'])
+      ->execute();
+
+    $this->assertEqual(count($connection_default->select('test')->fields('test')->execute()->fetchAllAssoc('name')), 2);
+    $this->assertEqual(count($connection_secondary->select('test')->fields('test')->execute()->fetchAllAssoc('name')), 0);
+
+    // Unset the transaction to commit it.
+    unset($transaction);
+
+    $this->assertEqual(count($connection_default->select('test')->fields('test')->execute()->fetchAllAssoc('name')), 2);
+    $this->assertEqual(count($connection_secondary->select('test')->fields('test')->execute()->fetchAllAssoc('name')), 2);
+  }
+
 }
 
