samedi 20 février 2016

Doctrine DBAL + Sqlite 3

I have a big problem with Doctrine DBAL & Sqlite3

Doctrine is Version v2.5.4

I get the connection working and I even get the 'fetchAll()' results. But when I do one insert, i get that the table is locked.

There is no other line of code - it justs load a long time and then I get this error:

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 5 database is locked' in

I don't know how I can unlock the table or why this is even needed. Do I do something wrong?

include_once 'vendor/autoload.php';

$config = new \Doctrine\DBAL\Configuration();
$connectionParams = array(
    'path' => 'database.sqlite3',
    'driver' => 'pdo_sqlite'
);
$db = \Doctrine\DBAL\DriverManager::getConnection($connectionParams, $config);

echo "Test SQLITE 3 <br>";
$data = $db->fetchAll("SELECT * FROM `table`");

$db->insert('table',array('area' => 'test', 'hash' => 'test', 'link' => 'testurl'));

Aucun commentaire:

Enregistrer un commentaire