Hi,
my problem is, that very often when i execute the following code:
public void prepare(GlobalTransaction gtx, String[] groupNames, BatchReplication[] batchReplication){
if(isDebug) log.debug("Begin Calling prepare");
log2pc.info("coordinator begin_commit");
try{
Object args[] = {gtx, groupNames, batchReplication};
Class classes[] = {GlobalTransaction.class, String[].class, BatchReplication[].class};
long startTime = System.currentTimeMillis();
ArrayList responseList = partition.callMethodOnCluster(ReplicatedCacheManager.RPC_HANDLE_NAME, "_rpc_runPrepare", args, classes, false);
long endTime = System.currentTimeMillis();
log.debug("Prepare Time\t" + (endTime-startTime));
if (responsesOk(responseList,ReplicationStatus.SUCCESSFULLY_COMPLETED)){
log2pc.info("coordinator commit");
commit(gtx, groupNames);
}else{
log2pc.info("coordinator abort");
rollback(gtx, groupNames);
}
/*if(isDebug){
log.debug("The list of responses from the other nodes are:");
Iterator it = responseList.iterator();
while(it.hasNext()){
log.debug("Response = " + it.next());
}
}*/
}catch(Exception e){
log.debug("Exception caught in prepare() = " + e.getMessage());
}
}
then only the coordinator (the one executing this) will receive the call and execute the method _rpc_runPrepare. Then, after 30 to 80 seconds all others will receive the call and execute it .
How can that happen? I get this problem only in 3 out of 10 tries and without the problem the call takes less then 100 ms. I'm using JBoss 4.0.2 .
Hope you can help me,
Sebastian