Re: ESQL/C transaction logging - outside a transaction?
Posted in 1997
>From: jharris@westpac.com.au (Jason Harris)
>Date: Wed, 20 Aug 1997 20:56:41 GMT
>X-Informix-List-Id: <news.41847>
>
>Dear All,
>
>My 0.02c worth.
>
>1. If the database is mode ANSI then any statement starts an implicit
> transaction, ...
Near enough correct that I'm not going to quibble... ROLLBACK WORK and
COMMIT WORK could be said to leave the database outside a transaction, but
since almost any other statement (other than CLOSE DATABASE) starts a new
transaction, it is a bit difficult to spot the difference.
> ... if just normal logging then only data modifying statements start a
> transaction.
Not really, and the only reason I'm responding to this message is because
this is not completely accurate.
In a plain logged database, the only statement which starts a transaction is
BEGIN WORK.
In an OnLine database with logging (MODE ANSI or not), every statement is
atomic - either it succeeds completely, or it fails completely and it is as
if the statement never executed at all. This is similar to a transaction,
but is distinct from a transaction, because the same property applies
whether the statement is executed inside an explicit user-activated
transaction or not.
I think it is achieved internally by using a savepoint to mark an
intermediate point in the transaction which the engine can roll back to if
the statement fails.
I think that unlogged OnLine database have the same property of atomic
statements, but I'm feeling rusty enough not to be definitive on that
point. And SE has different properties again...
>2. Correlated subqueries [...]
>
>On 20 Aug 1997 01:24:05 GMT, satriguy@aol.com (SaTriGuy) wrote:
>
>>>Can anyone tell me why
>>>transactions are being created when we never even begin a transaction to
>>>start with and does anyone know whether there's a way to turn this stuff
>>>off for particular apps and/or ESQL/C functions? Thanks.
>>
>>If the database is a logging database, then there is an implicit
>>transaction arround every command so that individual transactions can be
>>rolled back. Also, disk allocation/deallocations are always logged, even
>>with unlogged databases. Finally, any dml statements (i.e. create table,
>>etc) will be logged.
>>
>>Probably the best thing to do to figure out what is being logged is to
>>dump the log files via onlog (tblog).
Yours,
Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>
PS: Warning I do not reply to messages with anti-spam in the return path.