session rollback problem

manas

Member²
Main Session: Session1
Dll Session : SessionDLL1

I am editting a dataset(userflag) which is connected to the main session and waiting.
When I perform CancelUpdate([dataset]) in SessionDLL1, Session1 rollbacks.

P.S.: I use CacheUpdate for each table and CommitOnPost is False.
SessionDLL1 is being opened using externalSVA and in connection to Session1.

The reason for this is,to avoid the multiple connections of a user to the system at the same moment.

In order to achieve this, I lock a row of the userflag and avoid another user to edit it.

However, when one of the sessions in DLL is CancelUpdated this row is being unlocked and any other user can edit the userflag.
 
The question is: how do you lock the userflag record? A TOracleDataSet will only lock a record for a longer period if LockingMode = lmLockImmediate. For other LockingModes the lock is postponed until the actual update takes place, which will of course be rolled back by the CancelUpdates operation.

------------------
Marco Kalter
Allround Automations
 
I do not roll back Session1, I roll back sessionDLL1. But, as SessionDLL1 is connected to Session1 by externalSVC, Session1 also rollbacks.As you mention, I use
LockingMode = lmLockImmediate.
 
In that case you should set a Savepoint, and call RollbackToSavepoint instead of Rollback. Otherwise the locks will be rolled back as well.

------------------
Marco Kalter
Allround Automations
 
Please let me know whether a CancelUpdate or CommitUpdate operation on the SessionDLL1, effect the records in Session1.
Because, regarding my first question to you, I do not perform Roll back or CancelUpdate on Session1.

Please, let me know whether my problem occur when externalSVC is used. Because, there is no problem whenever the two sessions are logged on seperately using the classical methods.

Does a CancelUpdate or CommitUpdate performed on one of the sessions that are connected by externalSVC, effect the other sessions? For my application this operation effects the other sessions. Is this OK?

Best Regards,
 
If you use the ExternalSVC property (or use the Share procedure), both TOralceSessions will use the same database session. A rollback in one session will therefore also rollback changes made in the other session.

------------------
Marco Kalter
Allround Automations
 
Back
Top