Transaction trans = _transactions.get(tx);
if (trans.getMode() == TransactionModeType.LOCAL) {
return JDOConfFactory.createLocalTransactionDemarcation();
} else if (trans.getMode() == TransactionModeType.GLOBAL) {
Manager manager = trans.getManager();
if (manager == null) {
throw new CPAConfigException("No manager definition found "
+ "in global transaction config '" + tx + "'.");
}
String name = manager.getName();
if (name == null) {
throw new CPAConfigException("No manager name specified "
+ "in global transaction config '" + tx + "'.");
}
Properties props = new Properties();
for (int i = 0; i < manager.getParamCount(); i++) {
Param param = manager.getParam(i);
props.put(param.getName(), param.getValue());
}
return JDOConfFactory.createGlobalTransactionDemarcation(name, props);
} else {