[eluser]phazei[/eluser]
Ok, so after looking at the code, groups are transactions side by side, eg:
Code:
$this->db->trans_start(); //group1
$this->db->trans_complete(); //group1
$this->db->trans_start(); //group2
$this->db->trans_complete(); //group2
If group1 fails, then group2 would also fail to commit.
(
EDIT: but if group2 fails, group1 will NOT roll back since it's already committed. Basically in strict mode, once a transaction fails, any future transactions will not commit)
Though when looking at the code, I either found a bug, or totally missed something. From the snippet you posted:
Code:
if ($this->_trans_depth > 0)
{
$this->_trans_depth += 1;
return;
}
In order to start increasing depth, the _trans_depth needs to have begun, so it needs to be at least 1. Well, its default value is zero, so when it goes the first time, it ought to become 1...
I searched high and low, all over that file and I just could not find where it initially becomes 1 to be able to get into that if statement. So as far as I can tell, it never begins incrementing because it never gets past 0.
If it's there, please direct me to a line number. (I'm viewing CI1.7.0)
I think it should be
Code:
if ($this->_trans_depth >= 0)
{
$this->_trans_depth += 1;
return;
}
or simply remove the if statement altogether.