Does this start two transactions?

Does this code start two transactions and only end one (PostgreSQL 9.1)?

app.myDbase.SQLExecute("Begin Transaction")

rs.Edit
rs.Field("field1").StringValue = "string1"
rs.Field("field2").StringValue = "string2"
rs.Update

If app.myDbase.Error Then
     MsgBox("DB Error: " + app.myDbase.ErrorMessage)
     app.myDbase.Rollback
Else
     app.myDbase.SQLExecute("End Transaction")
End If

I was wondering if “BEGIN TRANSACTION” starts one transaction and rs.Update then starts another transaction, then “END TRANSACTION” only ends one transaction and leaves the second transaction still open.

There is only one transaction:

[code]app.myDbase.SQLExecute(“Begin Transaction”)

rs.Edit
rs.Field(“field1”).StringValue = “string1”
rs.Field(“field2”).StringValue = “string2”
rs.Update

If app.myDbase.Error Then
MsgBox("DB Error: " + app.myDbase.ErrorMessage)
app.myDbase.Rollback
Else
app.myDbase.Commit // Commit will end the transaction
End If[/code]
Note that app.myDbase.SQLExecute(“Begin Transaction”) as rs.Edit will start a transaction automatically.

OK. I was reading that rs.Update starts a transaction (which is ended by app.myDbase.Commit), so I thought that app.myDbase.SQLExecute(“Begin Transaction”) followed by rs.Update might initiate a second (nested) transaction. I was then concerned that app.myDbase.SQLExecute(“End Transaction”) might only close one of the two transactions.

I looked up nested transactions in PostgreSQL and found out that it is not possible in PostgreSQL. Once a transaction is started, a second BEGIN TRANSACTION does nothing.

In PostgreSQL, app.myDbase.SQLExecute(“End Transaction”) and app.myDbase.Commit do the same thing.

Of course, you’re right.