I need to know what i need to do to make a sequence os operations
atomic (work at all of nothing). I know that DATA operations
(insert,delete,etc...) works together with autocommit off and using
transactions. But when modifying tables, creating tables, creating
sequences, and other DDL operations, they are commit when run.
Thanks.
Rodrigo Spievak Cavalcanti
Sorry, DDL operations currently can not participate in a transaction
in the H2 database. Each DDL operation commits a transaction. There is
no workaround for this. I have a question: what is the use case?
Thomas
It's very simple, i have a distributable application, that do a schema
evolution checkup at startup,
checking for current application version and doing the updates (DATA +
DDL) on the database. If my application version
is 10, for example, and the current version is 20, there are 10 DDL
operations to be done, if one of this operations
fail the database is left in inconsistent state. Supose that 11 to 15
operations are sucessfull, and then occur a problem in 16 operation,
the operations that have been done (11, to 15) are not rolled back,
leaving the db in inconsistent state, requiring administrator
intervention.
This king of behaviour do exists in Postgresql, Mysql and some others.
On May 13, 7:20 am, "Thomas Mueller" <thomas.tom.muel...@gmail.com>
wrote:
> Hi,
>
> Sorry, DDL operations currently can not participate in a transaction
> in the H2 database. Each DDL operation commits a transaction. There is
> no workaround for this. I have a question: what is the use case?
>
> Thomas
>