Re: [sqlite] Calling "ROLLBACK" outside transaction

2012-10-28 Thread Igor Korot
Dan,

On Sun, Oct 28, 2012 at 10:07 PM, Dan Kennedy  wrote:
> On 10/29/2012 07:35 AM, Igor Korot wrote:
>>
>> Hi, ALL,
>> Will I be punished if I call ROLLBACK outside transaction?
>
>
> No. You will be rewarded with an error code though.

Good ;-) I guess I will need to find the error id to return  in this case.

Thank you.

>
> To check if an SQLite connection has an open write-transaction:
>
>   http://www.sqlite.org/c3ref/get_autocommit.html
>
> Dan.
> ___
> 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


Re: [sqlite] Calling "ROLLBACK" outside transaction

2012-10-28 Thread Dan Kennedy

On 10/29/2012 07:35 AM, Igor Korot wrote:

Hi, ALL,
Will I be punished if I call ROLLBACK outside transaction?


No. You will be rewarded with an error code though.

To check if an SQLite connection has an open write-transaction:

  http://www.sqlite.org/c3ref/get_autocommit.html

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


Re: [sqlite] Calling "ROLLBACK" outside transaction

2012-10-28 Thread Igor Tandetnik
Igor Korot  wrote:
> Will I be punished if I call ROLLBACK outside transaction?

You'll get an error (I would expect SQLITE_MISUSE), but otherwise nothing bad 
will happen.

> Thing is I'm trying to write a function in C++ that will be used
> mostly inside transactions
> but the usage will be general.

You could use sqlite3_get_autocommit to detect whether a transaction is in 
effect (autocommit is on when there is no explicit transaction, off when there 
is a transaction in progress).
-- 
Igor Tandetnik

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


[sqlite] Calling "ROLLBACK" outside transaction

2012-10-28 Thread Igor Korot
Hi, ALL,
Will I be punished if I call ROLLBACK outside transaction?

Thing is I'm trying to write a function in C++ that will be used
mostly inside transactions
but the usage will be general. So if there is an error I want to
ROLLBACK, but I don't want
to keep track of where am I: inside transaction or not.

Thank you.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users