[Robert.Hufsky@ser.at: autocommit in ecpg]
От | Michael Meskes |
---|---|
Тема | [Robert.Hufsky@ser.at: autocommit in ecpg] |
Дата | |
Msg-id | 20020118155409.GF6225@feivel.credativ.de обсуждение исходный текст |
Ответы |
Re: [Robert.Hufsky@ser.at: autocommit in ecpg]
|
Список | pgsql-hackers |
I just got this explanation for the autocommit setting. Maybe we should add thsi to the docs. ----- Forwarded message from Robert Hufsky <Robert.Hufsky@ser.at> ----- From: "Robert Hufsky" <Robert.Hufsky@ser.at> To: "Michael Meskes" <meskes@debian.org> Subject: autocommit in ecpg Date: Fri, 18 Jan 2002 08:21:17 +0100 [...] Transaction Control and Autocommit An application can be operating in "autocommit on" or "autocommit off" mode. The mode can be selected by issuing exec sql set autocommit to on; or exec sql set autocommit to off; Autocommit Off In this mode, no sql statement is ever committed unless explicitly stated by exec sql commit; >From the beginning of a database session an implicit transaction is open. Each SQL statement that is issued is part of the transaction. The transaction is closed and work is committed by exec sql commit;. Immediately after the exec sql commit; statement a new transaction is opened and the same rules apply. Note that an exec sql begin; statement is not applicable in "autocommit off" mode. Autocommit On In this mode, each statement is automatically committed. This can be convinient but it also can lead to performance problems as each implicit commit may cause a disk write operation. Even in "autocommit on" mode, multi-statememt transactions can be achieved by placing multiple SQL statements between exec sql begin; and exec sql commit; [...] ----- End forwarded message ----- Michael -- Michael Meskes Michael@Fam-Meskes.De Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!
В списке pgsql-hackers по дате отправления: