Igor Korot wrote:
> On Sun, Oct 21, 2012 at 11:01 PM, Darren Duncan <dar...@darrenduncan.net> 
> wrote:
>> If you want a rollback on the inner to rollback the outer unconditionally,
>> you never needed a nested transaction in the first place, but rather just
>> the one outer transaction 1,
>
> 1. Query all tables to grab the data according to table1_master.id
> 2. Present the data on screen and let the user edit the data. Delete
> the data retrieved in step 1.
> 3. Grab all the data in the appropriate class.
> 4. Start transaction 1 to insert the data.
> 5. Start transaction 2 to delete the data from tableN_slave
> 6. If 5 fails, rollback transaction 2, then transaction 1 (i.e. don't
> go with tr.1)
> 7. If 5 succeeds continue with transaction 1.
>
> What would be the best approach from sqlite point of view?

As Darren said, just do nothing for the inner transaction:
1. Query all tables to grab the data according to table1_master.id
2. Present the data on screen and let the user edit the data. Delete
   the data retrieved in step 1.
3. Grab all the data in the appropriate class.
4. Start transaction 1 to insert the data.
5. delete the data from tableN_slave
6. If 5 fails, rollback transaction 1 (i.e. don't go with tr.1)
7. If 5 succeeds continue with transaction 1.


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

Reply via email to