Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transaction documentation error and/or bug #1638

Closed
hwiesmann opened this issue Dec 30, 2018 · 1 comment · Fixed by #1645
Closed

Transaction documentation error and/or bug #1638

hwiesmann opened this issue Dec 30, 2018 · 1 comment · Fixed by #1645

Comments

@hwiesmann
Copy link


name: Bug report
about: Either the documentation in section "Enabling Transactions" is wrong or misleading and/or the transaction handling is buggy.


Describe the bug
The documentation says in section "Enabling Transactions":

Transactions are enabled automatically the moment you use $this->db->transStart(). If you would like to disable transactions you can do so using $this->db->transOff()

This might be a misleading documentation in case it is meant that transactions are enabled till $this->db->transOff() is called.
If you interpret the sentence as I do this is a bug because

  1. transStart() does not enable transactions (see code below)
	public function transStart($test_mode = false)
	{
		if ( ! $this->transEnabled)
		{
			return false;
		}

		return $this->transBegin($test_mode);
	}
  1. there is no method to enable transactions again once they have been switched off

CodeIgniter 4 version
CodeIgniter 4 Alpha 4

Affected module(s)
Database

@puschie286
Copy link
Contributor

puschie286 commented Jan 2, 2019

yes the docu text could be more clear - but the point is, there are no reasons to disable AND re-enable transaction. you can disable it for testing/dev purpose but in production application you have no reason to disable it ( because it lowers the security, stability, reliability ).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants