[ic] SQL Transactions Support (Commit/Rollback)

Cameron B. Prince interchange-users@icdevgroup.org
Sat May 17 13:46:01 2003


Hi all,

Is anyone out there using a recent version of Interchange with transactions
(i.e. commit and rollback) enabled on SQL queries?

The entire documentation on the subject seems to consist of:

----------
transactions
Reopens the database in transactions mode if Safe.pm is not active (e.g., in
a global subroutine, usertag or [perl global=1] tag). The limitation exists
because it is not possible to reopen a database within Safe.pm.
commit
Attempts to commit transactions
rollback
Attempts to rollback transactions
----------

* Turn off transactions by default in catalog.cfg -- not needed or wanted
for MySQL and DBM, two most common dbs. Since we have had virtually zero
complaint about transaction atomicity in general, it makes sense to disable
this. If someone wants transactions, they merely need to enable the
TRANSACTION_TABLES variable.

----------

* Transactions now fully supported. Can open a transaction-capable database
in transactions mode [flag type=transactions table="table"] and it will
commit all changes not done in transaction mode and reopen under transaction
constraints. [flag type=commit table=table] commits, [flag type=rollback
table=table] rolls back.

----------



I can't seem to find is an example of how to use this feature. It's clear to
me that I need to define the tables that I want use transactions on like:

Variable TRANSACTION_TABLES transactions orderline

But what's not clear to me is how to arrange the flag tags so that if a
query succeeds, it's committed and if it fails, it's rolled back.

The only page within the entire Interchange dist that seems to use this is
wizard/do_save.html in the admin pages. But there are no commands to commit
or rollback the queries.

I also don't understand what the docs mean about Safe.pm not being active.
Does this mean that I will need AllowGlobal set on the catalog?


Mike, could you or anyone elaborate on this?


Thanks,
Cameron