Subject | Transactions |
---|---|
Author | Jean Derrie Rigo |
Post date | 2005-11-18T17:11:05Z |
Hi,
Can I run a DDL statement inside a Transaction and rollback if some
Insert statements fail???
i.e.:
SET AUTODDL OFF;
Create table test (name varchar(10));
Insert into test (name) values ('test');
Rollback;
There is a problem, if I run that script, I get an error in the
INSERT command. The insert doesn't see the Test Table. But if I commit after
the Create it works, but I can't rollback the entire operation (until the
create table)...
Tanks,
Jean D. Rigo
rigo@...
-----Mensagem original-----
De: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] Em nome de Ann W. Harrison
Enviada em: sexta-feira, 18 de novembro de 2005 15:07
Para: firebird-support@yahoogroups.com
Assunto: Re: [firebird-support] Transaction Info
kapsee wrote:
could be rolled back, in limbo, or active. That marks the beginning of
the "interesting" transactions - those which could require special
handling. The database maintains an array in memory of the interesting
transaction states - two bits per transaction. If the array is very
large, you're wasting some memory.
The way to move the oldest transaction is to sweep the database with
gfix. It removes any records created by transactions that rolled back
and marks the transactions as committed.
The oldest active transaction is the oldest transaction that was
running at the start of the oldest transaction currently running.
Nothing created by a newer transaction can be garbage collected, so
cruft builds up when the oldest active is much below the next
transaction.
isc_info_oldest_transaction = 104,
isc_info_oldest_active = 105,
isc_info_oldest_snapshot = 106,
isc_info_next_transaction = 107,
Regards,
Ann
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Visit http://firebird.sourceforge.net and click the Resources item
on the main (top) menu. Try Knowledgebase and FAQ links !
Also search the knowledgebases at http://www.ibphoenix.com
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Yahoo! Groups Links
--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.3/174 - Release Date: 17/11/2005
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.3/174 - Release Date: 17/11/2005
Can I run a DDL statement inside a Transaction and rollback if some
Insert statements fail???
i.e.:
SET AUTODDL OFF;
Create table test (name varchar(10));
Insert into test (name) values ('test');
Rollback;
There is a problem, if I run that script, I get an error in the
INSERT command. The insert doesn't see the Test Table. But if I commit after
the Create it works, but I can't rollback the entire operation (until the
create table)...
Tanks,
Jean D. Rigo
rigo@...
-----Mensagem original-----
De: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] Em nome de Ann W. Harrison
Enviada em: sexta-feira, 18 de novembro de 2005 15:07
Para: firebird-support@yahoogroups.com
Assunto: Re: [firebird-support] Transaction Info
kapsee wrote:
>The oldest transaction is the first transaction that did not commit - it
> 3. gstat gives information about the oldest transaction and oldest
> active. What is the difference between the two ?
could be rolled back, in limbo, or active. That marks the beginning of
the "interesting" transactions - those which could require special
handling. The database maintains an array in memory of the interesting
transaction states - two bits per transaction. If the array is very
large, you're wasting some memory.
The way to move the oldest transaction is to sweep the database with
gfix. It removes any records created by transactions that rolled back
and marks the transactions as committed.
The oldest active transaction is the oldest transaction that was
running at the start of the oldest transaction currently running.
Nothing created by a newer transaction can be garbage collected, so
cruft builds up when the oldest active is much below the next
transaction.
> Is it possible toYes. Use the database info call.
> obtain this information using any firebird API ?
>
isc_info_oldest_transaction = 104,
isc_info_oldest_active = 105,
isc_info_oldest_snapshot = 106,
isc_info_next_transaction = 107,
Regards,
Ann
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Visit http://firebird.sourceforge.net and click the Resources item
on the main (top) menu. Try Knowledgebase and FAQ links !
Also search the knowledgebases at http://www.ibphoenix.com
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Yahoo! Groups Links
--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.3/174 - Release Date: 17/11/2005
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.3/174 - Release Date: 17/11/2005