lnResult = SQLEXEC(connection,"BEGIN TRANSACTION") IF lnResult = -1 * Error checking here and return. ENDIF * At this moment I have one open transaction on the backend. Looks ok to me. llSuccess = TABLEUPDATE(.T.,.F.,"cursoradapter1") && as soon as this executes, transaction is gone. IF NOT llSuccess *Error checking here and return ENDIF llSucces = TABLEUPDATE(.T.,.F.,"cursoradapter2") && this one is not in a transaction anymore.Then I thought: maybe the cursoradapter wants to enclose it's own update in a transaction, but it can't start it, because of the SQLSETPROP() setting. Let's make it have the transaction begun, then. So I modified base class, adding a SQLEXEC("BEGIN TRANSACTION") in BeforeCursorUpdate() event, hoping the multitable update structure will look like this:
BEGIN TRASACTION (1) - started programatically BEGIN TRASACTION (2) - in BeforeCursorUpdate() update COMMIT TRAN && made automatically by the CA - can't disable that BEGIN TRANSACTION (2) - in BeforeCursorUpdate() update COMMIT TRAN && made automatically by the CA - can't disable that COMMIT TRANSACTION (1) - executed programatically.In this case, I would be somehow happy. No luck. In this case, the code works like this:
lnResult = SQLEXEC(connection,"BEGIN TRANSACTION") IF lnResult = -1 * Error checking here and return. ENDIF * At this moment I have one open transaction on the backend. Looks ok to me. llSuccess = TABLEUPDATE(.T.,.F.,"cursoradapter1") * Stepping on through the code, BeforeCursorUpdate fires, then it executes the BEGIN TRANSACTION, and I have 2 open transactions. This looks ok too. After the update, trancount is 1, and it behaves at expected. IF NOT llSuccess *Error checking here and return ENDIF * Not to the second CA: llSucces = TABLEUPDATE(.T.,.F.,"cursoradapter2") * Stepping through the code, I see BEGIN TRANSACTION executed, switched to Enterprise Manager, see 2 open transactions, then follows the update. After the update BOTH TRANSACTIONS ARE GONE!!!!!Heh? Can you tell me again to study the examples, PLEASE?