Quantcast

SAVEPOINT with multiple databases

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

SAVEPOINT with multiple databases

Roman Fleysher
Dear SQLiters,

I think I came to a point where I need to learn SAVEPOINTs.

I am trying to understand documentation if creation and release of save points covers all presently attached databases, that is those before save point is created? Is attaching a database just a command that will sit on the transaction stack as any other, INSERT/UPDATE/DELETE?

Thank you,

Roman
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SAVEPOINT with multiple databases

Simon Slavin-3

On 16 May 2017, at 10:09pm, Roman Fleysher <[hidden email]> wrote:

> I think I came to a point where I need to learn SAVEPOINTs.
>
> I am trying to understand documentation if creation and release of save points covers all presently attached databases, that is those before save point is created? Is attaching a database just a command that will sit on the transaction stack as any other, INSERT/UPDATE/DELETE?

It doesn’t matter when a database is attached to a connection.  A savepoint is something which affects the current transaction for a connection, which is comprised of the INSERT/UPDATE/DELETE operations you mentioned.

One SQLite connection:
    Has access to at least one database, maybe more.
    Has none or one current transaction.

One transaction:
    Has zero or more savepoints.

Simon.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SAVEPOINT with multiple databases

Roman Fleysher
Oh,  now i understand. Thank you,  Simon.


Roman



-------- Original message --------
From: Simon Slavin <[hidden email]>
Date: 5/16/17 5:35 PM (GMT-05:00)
To: SQLite mailing list <[hidden email]>
Subject: Re: [sqlite] SAVEPOINT with multiple databases


On 16 May 2017, at 10:09pm, Roman Fleysher <[hidden email]> wrote:

> I think I came to a point where I need to learn SAVEPOINTs.
>
> I am trying to understand documentation if creation and release of save points covers all presently attached databases, that is those before save point is created? Is attaching a database just a command that will sit on the transaction stack as any other, INSERT/UPDATE/DELETE?

It doesn’t matter when a database is attached to a connection.  A savepoint is something which affects the current transaction for a connection, which is comprised of the INSERT/UPDATE/DELETE operations you mentioned.

One SQLite connection:
    Has access to at least one database, maybe more.
    Has none or one current transaction.

One transaction:
    Has zero or more savepoints.

Simon.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SAVEPOINT with multiple databases

David Raymond
One other minor thing of note is that attaching and detaching can only happen outside of a transaction. So you can't add or remove attached databases in the middle of a transaction, and transaction commit/rollback, or savepoint release/rollback will never leave you with a different set of attached databases than before that statement.


-----Original Message-----
From: sqlite-users [mailto:[hidden email]] On Behalf Of Roman Fleysher
Sent: Wednesday, May 17, 2017 12:25 AM
To: SQLite mailing list
Subject: Re: [sqlite] SAVEPOINT with multiple databases

Oh,  now i understand. Thank you,  Simon.


Roman



-------- Original message --------
From: Simon Slavin <[hidden email]>
Date: 5/16/17 5:35 PM (GMT-05:00)
To: SQLite mailing list <[hidden email]>
Subject: Re: [sqlite] SAVEPOINT with multiple databases


On 16 May 2017, at 10:09pm, Roman Fleysher <[hidden email]> wrote:

> I think I came to a point where I need to learn SAVEPOINTs.
>
> I am trying to understand documentation if creation and release of save points covers all presently attached databases, that is those before save point is created? Is attaching a database just a command that will sit on the transaction stack as any other, INSERT/UPDATE/DELETE?

It doesn’t matter when a database is attached to a connection.  A savepoint is something which affects the current transaction for a connection, which is comprised of the INSERT/UPDATE/DELETE operations you mentioned.

One SQLite connection:
    Has access to at least one database, maybe more.
    Has none or one current transaction.

One transaction:
    Has zero or more savepoints.

Simon.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SAVEPOINT with multiple databases

Roman Fleysher
Thank you, David. Now it totally makes sense to me. I realize this is SQL not SQLite question.

Thank you,

Roman

________________________________________
From: sqlite-users [[hidden email]] on behalf of David Raymond [[hidden email]]
Sent: Wednesday, May 17, 2017 12:38 PM
To: SQLite mailing list
Subject: Re: [sqlite] SAVEPOINT with multiple databases

One other minor thing of note is that attaching and detaching can only happen outside of a transaction. So you can't add or remove attached databases in the middle of a transaction, and transaction commit/rollback, or savepoint release/rollback will never leave you with a different set of attached databases than before that statement.


-----Original Message-----
From: sqlite-users [mailto:[hidden email]] On Behalf Of Roman Fleysher
Sent: Wednesday, May 17, 2017 12:25 AM
To: SQLite mailing list
Subject: Re: [sqlite] SAVEPOINT with multiple databases

Oh,  now i understand. Thank you,  Simon.


Roman



-------- Original message --------
From: Simon Slavin <[hidden email]>
Date: 5/16/17 5:35 PM (GMT-05:00)
To: SQLite mailing list <[hidden email]>
Subject: Re: [sqlite] SAVEPOINT with multiple databases


On 16 May 2017, at 10:09pm, Roman Fleysher <[hidden email]> wrote:

> I think I came to a point where I need to learn SAVEPOINTs.
>
> I am trying to understand documentation if creation and release of save points covers all presently attached databases, that is those before save point is created? Is attaching a database just a command that will sit on the transaction stack as any other, INSERT/UPDATE/DELETE?

It doesn’t matter when a database is attached to a connection.  A savepoint is something which affects the current transaction for a connection, which is comprised of the INSERT/UPDATE/DELETE operations you mentioned.

One SQLite connection:
    Has access to at least one database, maybe more.
    Has none or one current transaction.

One transaction:
    Has zero or more savepoints.

Simon.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Loading...