> On Mar 18, 2015, at 9:45 PM, Jason Vas Dias <jason.vas.dias at gmail.com> 
> wrote:
> 
> Would you care to expand on that ?

As it says on the tin [1]: you cannot start a transactions inside another 
transaction (use savepoint if you want that), so?

create table foo( value text, constraint uk unique( value ) );
begin transaction; insert into foo( value ) values( 'bar' ); commit; ? ok
begin transaction; insert into foo( value ) values( 'bar' ); commit; ? Error: 
UNIQUE constraint failed: foo.value
begin transaction; insert into foo( value ) values( 'baz' ); commit; ? Error: 
cannot start a transaction within a transaction
rollback; ? ok
begin transaction; insert into foo( value ) values( 'baz' ); commit; ? ok


[1] https://www.sqlite.org/lang_transaction.html


Reply via email to