Closure content executed as transaction in Doctrine DBAL

Code
<?php

use Doctrine\DBAL\Connection;

/* @var $connection Doctrine\DBAL\Connection */

$function = function (Connection $conn) {
    
$conn->insert('test', [
        
'id' => '3',
        
'name' => 'bar',
        
'creation_date' => '2014-07-23 07:27:18',
    ]);
};

$connection->transactional($function);

$sql 'SELECT * FROM test WHERE id = ?';
$result $connection->executeQuery($sql, [3])
    ->
fetchAll();

dump($result);
Result
array:1 [
0 => array:3 [
"id" => "3"
"name" => "bar"
"creation_date" => "2014-07-23 07:27:18"
]
]
Used Versions
PHP 7.1, Zend 3.0, Symfony 3.2, Laravel 5.2, PHPUnit 5.6, Doctrine 2.6