I do not know for other databases, but for Oracle, DDL (Data Definition
Language) statements cannot be rolled back. DDL statements are all
statements that affect the database structure, like table creation,
index creation, ...
> -----Original Message-----
> From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On
Behalf Of
> Patrick Hurley
> Sent: Thursday, December 01, 2005 4:37 PM
> To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> Subject: Re: [Rails] How to do a rollback
>
> On 11/30/05, Christian Gottardo
<christian.jadjiski-mZLRzTshxko39yzSjRtAkw@public.gmane.org>
> <christian.jadjiski-mZLRzTshxko39yzSjRtAkw@public.gmane.org> wrote:
> > Hi. I''d like to know how can i do a rollback after a
> > Table.new(params:id)?
>
> You need to put it into a transaction:
>
> Table.transaction do
>
> Table.new(....)
> # more stuff
>
> # if you leave the block via an exception, the transaction is
> # rolled back, if you leave it normally it is committed....
> end
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>