Hi *,

I have IMHO a very simple deadlock scenario, which sapdb 7.4 does not
detect:

Test scenario: sapdb 7.4
JDBC-Driver: 7.4.4    Build 001-000-156-902
autocommit off
tx isolation level COMMITTED_READ

3 concurrent thread doing in a loop the following:

1. Executing Query: SELECT PKEY FROM T_STATUS WHERE STATUSNAME
= 'MELDUNGSDATEN_GEAENDERT'
    There is exactly one hit - the mentioned table consists of only 5
entries.

2. Executing Update: UPDATE T_STATUS SET Zeitstempel = '" + new
Timestamp(System.currentTimeMillis()) + "' WHERE PKKEY = " + pkey
    -> Update the timestamp column of the entry in the result set.

3. commit()


The threads run for a while (approx. 20 sec. or so) - then you see the
first exceptions:
-->SQLException: com.sap.dbtech.jdbc.exceptions.DatabaseException: [600]
(at 75): Work rolled back,DEADLOCK DETECTED
that's fine - exactly what I would expect - after deadlock resolution the
threads work goes ahead, but then suddenly all the threads are
hanging - doing no work - no deadlock detection/resolution.
The only way to keep the system kind of running is to turn down
REQUEST_TIMEOUT parameter to small values (smallest possible is 31 sec) -
after doing this the requests are canceled
after that amount of time and continue their loop. But unfortunatly the
system is blocking for 31 sec...

Btw. we set the parameter DEADLOCK_DETECTION to the max (1000), but without
any noticable effect.

Some sidenotes:
When we have only 2 threads running - then we get never any deadlock - even
if the jdbc-trace assures that select from thread 1 and update from thread
2 interfere.

More interesstingly - if we put a random wait (0-1000 ms) between step 1
(query) and 2 (update) deadlock occure very rarely even at over 5
concurrent threads.

Can please somebody enlighten me what's going on here??

Thanks in advance,

Manuel Fehlhammer

sd&m AG

_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to