SET AUTOCOMMIT=0; -- Disable automatic COMMITs after each statement.
-- Tx #1.  Do your work here.
COMMIT; -- or ROLLBACK if there was an error.
-- Tx #2.  Do more work here.
COMMIT; -- etc...

Keep in mind that errors can result in either the offending statement
being rolled back (leaving the rest of the transaction intact), or in
some cases the whole transaction.  Also, certain types of query will
result in an implicit COMMIT (UNLOCK TABLES for example).

You would be wise to familiarize yourself with the particulars of how
different statements and errors interact with transactions before
attempting to actually implement them.  Familiarizing yourself with how
and why deadlocks happen, how to avoid them, and what to do when they
happen is also wise and will save you a lot of time and down the road.

-JF

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> Sent: Monday, September 08, 2003 8:07 PM
> To: [EMAIL PROTECTED]
> Subject: RE: Questions abou innodb
> 
> 
> InnoDB of course does not support
> > FULLTEXT indexes, and so forth.
> 
> Which is a pain, because i want the foreign key relationships 
> but fulltext
> indexing at the same time :\
> 
> As for transactions , is it simply by doing this?
> 
> start transaction
> do query
> commit
> if error
> rollback
> 
> ??
> 
> 
> 
> 
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    
> http://lists.mysql.com/mysql?> [EMAIL PROTECTED]
> 
> 


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to