Transactions in one table
Transactions in one table
От:
JORGE MALDONADO <jorgemal1960@gmail.com>
Дата:
Hi,
Does it make any sense to use transactions if only one DB operation is performed in only one table?
For example, insert only one record in a "countries" table without doing anything else in other table(s). One operation, one table, that´s it.
Best regards,
Jorge Maldonado
Re: Transactions in one table
От:
Olivier Gautherot <ogautherot@gautherot.net>
Дата:
Hi Jorge,
On Fri, Sep 27, 2019 at 1:22 PM JORGE MALDONADO <jorgemal1960@gmail.com> wrote:
Hi,Does it make any sense to use transactions if only one DB operation is performed in only one table?For example, insert only one record in a "countries" table without doing anything else in other table(s). One operation, one table, that´s it.
If it works, it will perform automatically a COMMIT. If it fails, it will perform a ROLLBACK. You don't gain much with atomic operations.
--
Olivier Gautherot
Re: Transactions in one table
От:
"David G. Johnston" <david.g.johnston@gmail.com>
Дата:
On Fri, Sep 27, 2019 at 9:22 AM JORGE MALDONADO <jorgemal1960@gmail.com> wrote:
Does it make any sense to use transactions if only one DB operation is performed in only one table?For example, insert only one record in a "countries" table without doing anything else in other table(s). One operation, one table, that´s it.
Its not necessary to explicitly issue a begin/commit but it also isn't something to actively avoid.
Dave
Re: Transactions in one table
От:
Rob Sargent <robjsargent@gmail.com>
Дата:
On 9/27/19 10:21 AM, JORGE MALDONADO wrote: > Hi, > > Does it make any sense to use transactions if only one DB operation is > performed in only one table? > For example, insert only one record in a "countries" table without > doing anything else in other table(s). One operation, one table, > that´s it. > > Best regards, > Jorge Maldonado When making changes interactively I highly recommend begin; ; like the number of affected rows; commit;