Merge pull request #1720 from KreizIT/develop

Fix rollback and test errno
This commit is contained in:
Laurent Destailleur 2014-07-07 21:23:32 +02:00
commit 1e28653aa9

View File

@ -229,15 +229,16 @@ abstract class CommonObject
} }
else else
{ {
$this->db->rollback();
if ($this->db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') if ($this->db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{ {
$this->error=$this->db->errno(); $this->error=$this->db->errno();
$this->db->rollback();
return -2; return -2;
} }
else else
{ {
$this->error=$this->db->error(); $this->error=$this->db->error();
$this->db->rollback();
return -1; return -1;
} }
} }