Skip to content

Connection: added inTransaction() - #218

Open
pavolbiely wants to merge 1 commit into
nette:masterfrom
pavolbiely:patch-1
Open

Connection: added inTransaction()#218
pavolbiely wants to merge 1 commit into
nette:masterfrom
pavolbiely:patch-1

Conversation

@pavolbiely

Copy link
Copy Markdown

A new inTransaction() method might be a very useful shortcut.

Calling is unnecessary long right now.

/* @var \Nette\Database\Connection $db */
if ($db->getPdo()->inTransaction()) {
   $db->rollBack();
}

Why not just use it like this?

/* @var \Nette\Database\Connection $db */
if ($db->inTransaction()) {
   $db->rollBack();
}

Other shortcuts like beginTransaction(), commit() and rollback() are already implemented in Connection class.

@dg
dg force-pushed the master branch 5 times, most recently from 9b70c0e to dfb79e3 Compare March 17, 2019 06:22
@dg
dg force-pushed the master branch 3 times, most recently from cba566a to 302586e Compare April 1, 2019 04:56
@pavolbiely

Copy link
Copy Markdown
Author

Is there something wrong with the implementation? I could help but got no response.

@EdaCZ

EdaCZ commented Jul 26, 2019

Copy link
Copy Markdown
Contributor

@dg What do you think?

@dg

dg commented Aug 5, 2019

Copy link
Copy Markdown
Member

Please can you add simple test?

@dg
dg force-pushed the master branch 2 times, most recently from 4c0e8d0 to e17242a Compare November 19, 2019 18:28
@dg
dg force-pushed the master branch 6 times, most recently from f9fc19d to dd75e74 Compare December 13, 2019 18:06
@dg
dg force-pushed the master branch 2 times, most recently from cce6a9c to 7e705c5 Compare December 27, 2019 03:53
@dg
dg force-pushed the master branch 2 times, most recently from 9acf825 to a268c60 Compare March 27, 2020 11:52
@dg
dg force-pushed the master branch 2 times, most recently from a56e7fe to d9b5f29 Compare June 9, 2020 14:19
@dg
dg force-pushed the master branch 9 times, most recently from 82f287a to fbffc75 Compare March 4, 2021 19:57
@dg
dg force-pushed the master branch 7 times, most recently from 07bedd3 to d87063e Compare April 5, 2021 15:44
@dg
dg force-pushed the master branch 8 times, most recently from e29b33b to ba62a2a Compare April 23, 2021 18:59
@dg
dg force-pushed the master branch 2 times, most recently from 5e1c47e to 9f3937f Compare May 4, 2021 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants