I'm having troubles with transactions on postgresql, they all return:
Fatal error: Uncaught exception 'Zend_Db_Statement_Exception' with message
'SQLSTATE[25P02]: In failed sql transaction.
Heres the code:
$this->getDefaultAdapter()->beginTransaction();
$Users = new Sistema_Model_Usuarios();
$idUser = $Users->save($data);
if ($idUser) {
$Row = $this->getRow($data['id']);
if ($Row->save()) {
$this->getDefaultAdapter()->commit();
return $Row->id;
} else {
$this->getDefaultAdapter()->rollBack();
return false;
}
}
my getRow function is as follow:
public function getRow($id) {
try {
$Row = $this->find(trim($id))->current();
if (!$Row) {
$Row = $this->createRow();
}
} catch (Exception $e) {
$Row = $this->createRow();
}
return $Row;
}
I've tried a lot of things, but none seems to do the trick..
IF i dont start a transaction, everything works..
Please help!
--
View this message in context: http://n4.nabble.com/Transactions-failing-with-postgresql-tp1016829p1016829.html
Sent from the Zend DB mailing list archive at Nabble.com.
没有评论:
发表评论