From: Jojakim S. <JS...@de...> - 2002-11-22 10:54:53
|
> > What about building a similar solution: BeginTransaction(), Commit(bool > > retaining) or Rollback(bool retaining). Standard Commit() / Rollback() > > call > > these methods with retaining=false. The only thing, I'm not > sure about is, > > whether it should be necessary to call BeginTransaction() after a > > Commit/Rollback(retaining=true). I tend to prefer not to call > > BeginTransaction() again. > > > I have no problem in add these two methods as overloaded methods for > Commit and Rollback but possible can be better to implement savepoints. But as far as I know, savepoint and retaining transactions are not the same. If you commit retaining, you have no possibility to rollback what you have committed, only the transaction environment (=the snapshot of row versions) remains within the new transaction. A savepoint is a point within an overall transaction (I don't know the exact implementation in firebird 1.5, so I speak with the MSSQLServer knowledge), you can BeginTransaction("Point0"); DBOps... Save("Point1"); DBOps... Save("Point2"); DBOps... Rollback("Point1"); // Cancels all DBOps made since Save("Point1") DBOps... Save("OtherThings"); Rollback("Point0"); // Cancels complete transaction So if firebird 1.5 has savepoints, perhaps we need both methods. To propose some good method names and signatures I have to look at firebird 1.5 docu/source to inform myself about the savepoints implemented there. -- Joja |