That's two transactions. I want to be able to roll back. I wrote
some test code that suggests that transactions work the way I expect
them to.
Charles Yeomans
On Dec 5, 2006, at 7:27 PM, Tom Benson wrote:
Or you can
UPDATE
COMMIT
SELECT
UPDATE
COMMIT
- Tom
On 06/12/2006, at 9:54 AM, Carlos M wrote:
On Dec 05, 2006 8:58 PM, Charles Yeomans wrote:
Suppose I have a REALSQLDatabase transaction having the following
form.
UPDATE
SELECT
UPDATE
COMMIT
Should the SELECT statement see the effect of the UPDATE statement?
It seems like it should.
Reading the LR for 2006r4, there's an "AutoCommit" property that
is set by
default to False, so the SELECT above shouldn't see the changes.
The AutoCommit says: "Determines whether the database commits changes
automatically, or whether changes open an implicit transaction
that you must
explicitly close by calling Commit or Rollback. The default is
False: Changes
open implicit transactions that you must close explicitly. If you
set AutoCommit
to True, then the database will no longer open implicit
transactions for you,
and instead, will automatically commit each database change
immediately."
So, if you need to see the changes you should set AutoCommit to
true before the
UPDATE statement (the COMMIT statement is not necessary to use in
this case).
---
This is something that is different than the default SQLite
behavior. From
SQLite.org:
"Any command that changes the database (basically, any SQL command
other than
SELECT) will automatically start a transaction if one is not
already in effect.
Automatically started transactions are committed at the conclusion
of the
command. Transactions can be started manually using the BEGIN
command. Such
transactions usually persist until the next COMMIT or ROLLBACK
command"
Carlos
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>