Re: Database exceptions
- To: firstname.lastname@example.org
- Subject: Re: Database exceptions
- From: "Alexey Parshin" <email@example.com>
- Date: Tue, 23 Dec 2008 22:02:25 +1100
- Delivered-to: mailing list firstname.lastname@example.org
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=hvPRM1mc1p/QGVDCV4+DKWQL/VA/BIZI8xaAsR+risE=; b=bKtmqlCymCT4hI3zocnhWXucx6ehxl//cYGWwEMAXn1K0IPGKH4Kpsdmd+QdjS8/vz pErGjnATodZLF6F9v+ToP+6BH6knbLMLWFpW6kXe664ThDL3lVRF7K1ZcsILsw8yP/71 +8+VmdxDY7o9yNnArFGiBJYM4Sq0mt4xHDJhQ=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=TTCOyCupQrgvNPjFkuAwenMWVh8rC6E6srvQmhn0C2l9xISeO3sbv7u4bnkBxfqkQK H7411B2NmR/VF94BwTZ62/9ycB0CuH354zJDtZ46U1CiwJsgZIRW0BoHXSQKUDJXAeKA DAMpywzIPHjCfblbljsBf7jyuJNQ+f6ceLGaI=
- In-reply-to: <49504D91.email@example.com>
- Mailing-list: contact firstname.lastname@example.org; run by ezmlm
- References: <49504D91.email@example.com>
The database exceptions are thrown in several different situations. This includes both read-only data access and data modifications. Normally, exceptions thrown by the stored procedures (any data access is done through stored procs) are re-thrown by sptk::CQuery as sptk::CException.
By the definition, any call of the stored procedure is a transaction. If the exception is thrown from within the stored procedure, the transaction is terminated and rolled back by PG server, to the state before the procedure call. If no exceptions are thrown, stored proc exits and transaction is committed by PG server.
The exception from the above rule is the manual transaction start (using CTransaction) and performing several procedure calls followed by explicit commit (rollback happens on exceptions), but this isn't used in UU at this point.
2008/12/23 Ilya A. Volynets-Evenbakh <firstname.lastname@example.org>
I have a few questions regarding UU database.
What happens if database exception is thrown in UU?
Does anything rollback? To what point?
Also, when does commit of a transaction happen?