db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ecker Sandor <esa...@freemail.hu>
Subject derby (dead)lock exception
Date Fri, 09 Nov 2012 11:54:43 GMT
Hi,

I'm getting the following exception.

    <-: 'deleteByIds' throws '[DatabaseException@74c9e3[
      Internal Exception: java.sql.SQLTransactionRollbackException: DERBY SQL error: SQLCODE:
-1, SQLSTATE: 40001, SQLERRMC: Lock : ROW, TRIP_TIMETABLE, (1,20)
        Waiting XID : {5144, U} , TTM, DELETE FROM TRIP_TIMETABLE WHERE EXISTS(SELECT ID FROM
TRIP WHERE (ID IN (?)) AND ID = TRIP_TIMETABLE.trips_ID)
        Granted XID : {5150, X} 
      Lock : ROW, TRIP_TIMETABLE, (1,19)
        Waiting XID : {5150, U} , TTM, DELETE FROM TRIP_TIMETABLE WHERE EXISTS(SELECT ID FROM
TRIP WHERE (ID IN (?)) AND ID = TRIP_TIMETABLE.trips_ID)
        Granted XID : {5144, X} 
      ^T5144^T40001
      Error Code: -1

Does this mean I had a deadlock? I guess there are two transactions 5144, 5150, they execute
the same query. What does U and X mean after the trans. Ids?

The query is:

DELETE FROM TRIP_TIMETABLE 
WHERE EXISTS(
          SELECT ID FROM TRIP WHERE (ID IN (?)) AND ID = TRIP_TIMETABLE.trips_ID
)

What can be wrong with this query?

Thanks,
Regards,
Sandor

Mime
View raw message