From: Brian Candler Date: 2003-06-08T23:25:24+09:00 Subject: Re: [ANN] sql-serialize 0.0.3 On Sun, Jun 08, 2003 at 05:15:00PM +0900, Anders Borch wrote: > >> rescue DBI::DatabaseError => dbe > >> dbi.do("ROLLBACK") > >> throw dbe > >> end > > > > > >Are you sure that's right??? I think you want to do a rollback for *all* > >exceptions. That's one reason why the 'transaction do ... end' model might > >be better. > > uhm... what are you thinking about specifically? Absolutely any exception. NameError or ValueError for programming errors you hadn't thought about. System errors if the database suddenly becomes unreachable or you run out of RAM - anything. If you don't rollback changes in those circumstances, then the half-transaction which you have already written may get written later along with a subsequent transaction. B.