Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.3.3
-
Fix Version/s: 2.0.0
-
Labels:None
-
Number of attachments :
Description
Hello,
I use LRCXADatasource for a non XADatasource in my project, but when I commit, if one of the other XADatasource fails in prepare phase, the prepare (so the commit) is still execute on the LRCXAResource : so I can't rollback it, because this resource was committed during prepare.
Does I use it properly or is it a bug ?
I thinks it's a bug because I see in AbstractPhaseEngine class, you run the prepare phase on all the resources (even LRC) before looking for errors :
while (it.hasNext())
{ Object positionKey = it.next(); ... List resources; ... JobsExecutionReport report = runJobsForPosition(resources); ... }... and then looking for errors, but it's too late.
I'll propose to add a break in executePhase method of AbstractPhaseEngine class, like this :
Iterator it = positions.iterator();
while (it.hasNext()) {
Object positionKey = it.next();
List resources;
if (reverse)
else
{ resources = resourceManager.getNaturalOrderResourcesForPosition(positionKey); } if (log.isDebugEnabled()) log.debug("running " + resources.size() + " job(s) for position '" + positionKey + "'");
JobsExecutionReport report = runJobsForPosition(resources);
if (report.getExceptions().size() > 0)
if (log.isDebugEnabled()) log.debug("ran " + resources.size() + " job(s) for position '" + positionKey + "'");
}
Is this correct ?
Quentin.