Server hangs on StartTransactionWith
Brought to you by:
tpsfadmin
Let's see if this bug reporting system works!
I've discovered a way to hose the server (2.12 or 2.13
beta) using StartTransactionWith.
In my demo application (attached), I have two sets of
table/database/.../transport components to simulate two
clients. Here's the sequence of events that causes a
crash:
1. Client A starts a transaction and gets a read lock on
table 2.
2. Client B calls StartTransactionWith( [ Table1,
Table2 ] ). This should fail, since client A has a lock on
Table2, and it does.
3. Client A rolls back or commits its transaction.
4. Client B calls StartTransactionWith again. Kablooie!
I'm using Delphi 4.
Logged In: YES
user_id=695753
I think we found a fix. Everywhere GetCursorIDAndGet is
called, Cursor.Deactivate is later called. However, it isn't in
once place in TffServerEngine.TransactionStartWith. Here's
the modified code:
if Result <> DBIERR_NONE then
for anIndex := 0 to Limit do begin
aCursorID := TffCursorID(aCursorIDs[anIndex]);
GetCursorResult := CheckCursorIDAndGet
(aCursorID, Cursor);
if GetCursorResult = DBIERR_NONE then begin
try {!!Speedline}
Cursor.RelContentLock(ffclmWrite);
finally {!!Speedline}
Cursor.Deactivate; {!!Speedline}
end; {!!Speedline}
end;
end; { for }