> Is there a way to do this today? How hard would it be to add "commit to
> savepoint" if not?

It's impossible to do the thing you want in SQLite. And it won't be
feasible to add that.
What you really want is for database engine to allow to have two
parallel writing transactions and for it to not lock the whole
database in those transactions but do some fine-grained locking
instead. In this case you will be able to do A in one transaction
(over one connection) and C in another transaction (over another
connection). Then when you are ready you commit first transaction
leaving second uncommitted. You should use some other RDBMS for that,
SQLite is not suitable for such task. If you insist on using SQLite
you should cache yourself all changes in C somewhere outside the
database. Then when you commit everything done in A you can apply all
cached changes...


Pavel

On Thu, Jan 13, 2011 at 6:16 PM, Charles Samuels <char...@cariden.com> wrote:
>
> Hi,
>
> I have a program that uses sqlite to do bookkeeping for another set of data. I
> do a commit on sqlite once I'm certain the other set of data is done. While
> I'm waiting for the other set of data to process, I might make other changes
> to my Sqlite database. However, I don't want to commit the stuff made after I
> started to process the other set of data.
>
> In short, I want a "commit to savepoint savepoint-name" which commits up until
> a savepoint begins, but not anything after.
>
> Here's more or less what I need:
>
> A * sqlite gets some inserts
> B * we're at a checkpoint, so everything after this point shouldn't get
> committed now. So "savepoint SP"
> C * insert some more into sqlite
> D * The checkpoint is ready to go, so we do "commit to savepoint SP"
> E * now, on-disk, the sqlite db contains everything in step A, but nothing in
> step C
>
> In this example, doing the commit at D is the same as doing in between A and
> B.
>
> Is there a way to do this today? How hard would it be to add "commit to
> savepoint" if not?
>
> Thanks,
>
> Charles
>
> ps: I think the documentation on savepoint is a little bit unclear on if
> "rollback to savepoint" and "release savepoint" keep the savepoint in question
> as the active savepoint.
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to