On Dec 06, 2006 5:34 AM, Peter Bozek wrote:
> On 12/5/06, Carlos M <[EMAIL PROTECTED]> wrote:
> > 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).
>
> I did not tested it, but IMHO all SQL commands see changes to data
> done within transaction they are in. It menas SELECT will see changes
> done by previous UPDATE statement, because the UPDATE was executed in
> the same transaction.

Peter, you're completely right!!! I don't know what I was thinking when I wrote
that - I even do it a *lot* of times on same transaction on MS SQL and I just
tested it on SQLite and it works in same way. My apologies!

---

I found something on 2006r4 that is somewhat confusing about the AutoCommit
property. The LR 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."

My understanding fro what the LR says is that if AutoCommit is set to False you
must *always* use COMMIT or ROLLBACK when making changes to a DB (when using
INSERT, UPDATE or DELETE).

But from my tests, this is not correct on 2006r4, as records are inserted
without using COMMIT if AutoCommit is set to false. The simple test I did was:
 DB.AutoCommit = False
 DB.SQLExecute "INSERT INTO foo..."
 DB.SQLExecute "INSERT INTO foo..."

In this situation, records are inserted without using COMMIT, and in my opinion
is correct.

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>

Reply via email to