Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Well, after struggling with the problem, And @dmirkitanov reply with the idea why this may happen.</p> <blockquote> <p>It might be related with transactions, if, for example, this code runs in a transaction, and there is no commit after it</p> </blockquote> <p>I notice that on the PDO Singleton Class, some one in the project adding a new line. *See the commented line of code</p> <pre><code>&lt;?php include('config.database.php'); class Database { protected static $instance = null; final private function __construct() {} final private function __destruct() { //self::$instance-&gt;commit(); self::$instance = null; } final private function __clone() {} public static function getInstance() { if (self::$instance === null) { try { self::$instance = new PDO( 'pgsql:host=' . DatabaseConfig::HOST . ';port=' . DatabaseConfig::PORT . ';dbname=' . DatabaseConfig::DBNAME . ';user=' . DatabaseConfig::USER . ';password=' . DatabaseConfig::PASSWORD ); self::$instance-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); self::$instance-&gt;setAttribute(PDO::ATTR_EMULATE_PREPARES, true); //self::$instance-&gt;beginTransaction(); } catch (PDOException $e) { self::$instance-&gt;rollBack(); die('Database connection could not be established.'); } } return self::$instance; } public static function __callStatic($method, $args) { return call_user_func_array(array(self::instance(), $method), $args); } } ?&gt; </code></pre> <p>So as you can see, <code>beginTransaction()</code> is set in the <code>getInstance()</code>, but the <code>commit()</code> is set in <code>__destruct()</code></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload