I'm developing a feature on derby engine that needs to abort transactions on committing stage. I'm working on Derby v10.2.2.0, the main project was not ported yet to v10.3. Transactions are being forced to abort in two more places, on waiting by not granted lock and just before execution of a prepared statement.
I found that abort transactions on commit without careful leads to exception java.lang.ArrayIndexOutOfBoundsException at java.util.ArrayList.remove(ArrayList.java:418) at org.apache.derby.iapi.services.context.ContextManager.popContext(ContextManager.java:199) at org.apache.derby.iapi.services.context.ContextImpl.popMe(ContextImpl.java:81) at org.apache.derby.impl.store.access.RAMTransaction.destroy(RAMTransaction.java:2052) at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.commitNestedTransaction(GenericLanguageConnectionContext.java:1510) at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:615) ... Works better if i filter by name, of the transaction, to NESTED_READONLY_USER_TRANS not being forced to abort at committing stage. I can describe better my project if need. Can this exception be a bug at this old version of Derby? Looking at XactFactory, we can have transaction with these contexts - USER_CONTEXT_ID - NESTED_READONLY_USER_CONTEXT_ID - NESTED_UPDATE_USER_CONTEXT_ID - INTERNAL_CONTEXT_ID - NTT_CONTEXT_ID and more at AccessFactoryGlobals - NESTED_READONLY_USER_TRANS - NESTED_UPDATE_USER_TRANS I need some help to understand this. What transactions with these context do? When is this NESTED_READONLY_USER_TRANS called? Thanks! PJ
