[New text /below/ any text you want to quote, please.]

On 9 Aug 2010, at 9:09pm, Josh wrote:

> Thanks for the answers, but I guess I should have made my question more 
> clear. I knew that you can commit every sql statement individually, then 
> the question would be, how can I roll them back?
> 
> In other words I'd like something like savepoint and rollback to 
> savepoint, while not loosing the transactions if there is a power failure. 
> I know I can have either one of these, but can I have both!?

The difficulty is that there's no way to ask the database which savepoints it 
was in the middle of when it crashed, and how far through each savepoint it 
was.  For instance, suppose you were working on a SAVEPOINT concerning 20 rows 
when you lost power.  With the system you describe, when power is restored you 
need to know you were on row 16 of SAVEPOINT A, so you can write the other 4 
rows, then RELEASE it.  But you can't find that information useful in any way, 
because the system crashed before the other 4 rows made it to disk, so you've 
lost all the data about them.  So your only real option is to ROLLBACK the 
whole savepoint.  So you might as well not have the partial savepoint 
information there in the first place.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to