Jim Starkey wrote: > Brian Aker wrote: >> Hi! >> >> In working on replication I end up in our transaction code. Today DDL >> causes whatever transaction that is in play to commit. >> >> Is this really a good behavior? >> >> I am looking at cleaning up the API so that an engine will be able to >> do transactional DDL (assuming it can handle it). This piece of >> behavior is going to cause this to become... messy. >> >> Should we toss an error on DDL if the engine does support it >> transactionally? Current behavior good enough/would break too much to >> change? >> >> What is the proper behavior? >> > > First, it is imperative that the server never do an implicit commit > except, perhaps, on a declared batch load. An implicit rollback is > pretty stinky, too, but less likely to destroy or corrupt application data.
Shocking... I totally agree. Implicit commits bad (unless in autocommit mode, in which case every statement should be atomic anyway) > That said, if the engine insists on doing DDL as part of a transaction, > doing the DDL as part of an independent transaction is probably the way > to go. The DML transaction may not see the DDL operation until it > finishes the current transaction, which is probably a good thing. > > I've never been a fan of transactional DDL, though Firebird users ask > for it frequently. Maintaining multiple physical formats is > straightforward; maintaining multiple logical formats is a royal pain in > the butt. > > My strategy (Nimbus, Falcon, Firebird, Rdb/ELN) is: > > * Compile statements with current logical definition > * Create new format versions (physical formats) on DDL > * Create new records / versions with the current physical format > * If a running statement violates a constraint, even a constraint > that didn't exist when the statement was compiled, throw an error > * Invalidate all statements in the compiled statement cache > referencing an altered table as part of the DDL operation (but > don't invalidate running statements) > > If implemented carefully, none of this costs anything at all. > > _______________________________________________ Mailing list: https://launchpad.net/~drizzle-discuss Post to : [email protected] Unsubscribe : https://launchpad.net/~drizzle-discuss More help : https://help.launchpad.net/ListHelp

