Details
Description
When executing parallel SELECT statements accessing to a table with a binary column, sometimes an error indicating that a page was attempted latched twice is received while reading the value of the binary column.
This error ERROR XSDAO: Internal error: page Page(334,Container(0, 1456)) attempted latched twice is received when connection is inside a transaction.
In case the connection is not in a transaction, the error is different: ERROR 40XD0: Container has been closed
I attach a Java class for reproducing the issue. It has the following lines for testing both versions of the error
//conn.setAutoCommit(true); //ERROR 40XD0: Container has been closed. conn.setAutoCommit(false); //ERROR XSDAO: Internal error: page Page(334,Container(0, 1392)) attempted latched twice.
This is an example of the received error.
Exception in thread "pool-1-thread-1" java.lang.RuntimeException: java.io.IOException: ERROR XSDAO: Internal error: page Page(334,Container(0, 1456)) attempted latched twice. at org.scruz.derby.TestTx$Access.run(TestTx.java:60) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:833) Caused by: java.io.IOException: ERROR XSDAO: Internal error: page Page(334,Container(0, 1456)) attempted latched twice. at org.apache.derby.impl.store.raw.data.OverflowInputStream.fillByteHolder(OverflowInputStream.java:168) at org.apache.derby.impl.store.raw.data.BufferedByteHolderInputStream.read(BufferedByteHolderInputStream.java:37) at java.base/java.io.FilterInputStream.read(FilterInputStream.java:82) at java.base/java.io.FilterInputStream.read(FilterInputStream.java:82) at java.base/java.io.FilterInputStream.read(FilterInputStream.java:82) at org.apache.derby.iapi.services.io.CloseFilterInputStream.read(CloseFilterInputStream.java:60) at org.scruz.derby.TestTx$Access.run(TestTx.java:55) ... 3 more Caused by: ERROR XSDAO: Internal error: page Page(334,Container(0, 1456)) attempted latched twice. at org.apache.derby.shared.common.error.StandardException.newException(StandardException.java:300) at org.apache.derby.shared.common.error.StandardException.newException(StandardException.java:295) at org.apache.derby.impl.store.raw.data.BasePage.setExclusive(BasePage.java:1710) at org.apache.derby.impl.store.raw.data.BaseContainer.latchPage(BaseContainer.java:527) at org.apache.derby.impl.store.raw.data.FileContainer.latchPage(FileContainer.java:3532) at org.apache.derby.impl.store.raw.data.FileContainer.getUserPage(FileContainer.java:2551) at org.apache.derby.impl.store.raw.data.FileContainer.getPage(FileContainer.java:2593) at org.apache.derby.impl.store.raw.data.BaseContainerHandle.getPage(BaseContainerHandle.java:319) at org.apache.derby.impl.store.raw.data.OverflowInputStream.fillByteHolder(OverflowInputStream.java:151) ... 9 more