Hi All!
 I've been reading about SAVEPOINT and ROLLBACK in the SQLite documentation. My 
project has an embedded SQLite DB with multiple tables (relational) that may or 
may not be read or updated because of choices the user makes.  Am I 
understanding correctly that I can use these commands to rollback to the 
previous savepoint if there is an error, or the user changes their mind? This 
is all through Java code, so I wasn't sure if the PreparedStatement "Execute()" 
or "ExecuteQuery" would still allow a rollback if I'm understanding correctly. 
For example, would I do this:
Connect to the DB
[ Pass the command to save: ]    SAVEPOINT 'current'
[ User choices are processed: SELECT and UPDATE statements ]
[ if error or user changes their mind ]    ROLLBACK TRANSACTION TO SAVEPOINT 
'current'

[ otherwise... upon success ]    RELEASE SAVEPOINT 'current'

Close DB connection
Thanks for your time!
Scott ValleryEcclesiastes 4:9-10
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to