Consultor Eletrônico



Kbase P6063: Java App Fails When Using JDBC And Attempting To Read Phantom Records
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   15/10/2008
Status: Verified

FACT(s) (Environment):

Progress 9.1C
Progress 9.1D

SYMPTOM(s):

JDBC

Read of a phantom record causes Java application to fail

CAUSE:

Java application does not have logic to handle the case where a record read fails due to the JDBC driver not being able to obtain a lock

FIX:

The default transaction isolation level (REPEATABLE READ) must acquire a share lock on the record when reading it and it is possible under this level to attempt to read a phantom record (one that has had enough information written to it that some index entries have been written to the database) and then fail because the phantom record is still locked by another process so the attempt to get a share lock fails.

The solution to this problem is to properly handle the Java exception that JDBC will generate under this scenario and bypass the record.