}
}
private void applyTransaction0( JODBOperationContext context, IOTicket writeTicket, boolean writeLocked ) throws IOException, IllegalClassTypeException{
//local transaction only
TransactionContainer transactionContainer = context.getTransactionContainer();
IOTicket readTicket = context.getIoTicket();
if(JODBConfig.DEBUG){
_logger.info(" ******************* Transaction start for container="+System.identityHashCode(transactionContainer));
}
//JODBSession session, IOTicket readTicket, IOTicket writeTicket
//JODBOperationContext context = new JODBOperationContext(session,readTicket,null,transactionContainer);
long transactionOffset = getTransactionOffset();
context.setTransactionOffset(transactionOffset);
try{
readTicket.lock(false, 0);//for transaction assembling we need only read lock
TransactionAssembler.assembleTransactionData(context, transactionContainer);
}finally{
readTicket.unlock();
}
//transaction lock engaged earlier so no one will ask for write lock concurently
////////////////////// WRITE LOCK PHASE ////////////////////
if(!writeLocked){
writeTicket.lock(true, 0);
}
transactionContainer.processTranslatedObjectsIndex(context, transactionOffset);
transactionContainer.resetTransactionBufferToEnd();
try {
transactionContainer.enableAgentMode();
TransactionAssembler.assembleTransactionData(context, transactionContainer);
} finally {
transactionContainer.disableAgentMode();
}
applyTransaction0(context.getSession(), transactionContainer, transactionOffset, writeTicket);
}