Skip to content

Transaction documentation error and/or bug #1638

Description

@hwiesmann

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions