Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

https://github.com/atomikos/transactions-essentials/issues/217 #218

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ public void addExtent(Extent extent) throws SysException, IllegalArgumentExcepti
if (!ct.getTid().equals(extent.getParentTransactionId())) {
throw new IllegalArgumentException("The supplied extent is for a different transaction: found " + extent.getParentTransactionId()+ " but expected " + ct.getTid());
}
for (Participant p : extent.getParticipants()) {
String rootId = ct.getCompositeCoordinator().getRootId();
// detect rccursive call
if (rootId != null && p.getURI().endsWith(rootId))
return;
}
ct.getExtent().add(extent);
Stack<Participant> participants = extent.getParticipants();
for (Participant p : participants) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ public int prepare() throws RollbackException, HeurHazardException, HeurMixedExc
if (LOGGER.isDebugEnabled()) {
LOGGER.logDebug("Calling prepare on " + getURI());
}
// happens for recursive calls
if (cascadeList.isEmpty()) {
return Participant.READ_ONLY;
}
try {
int result = target.request()
.buildPost(Entity.entity(cascadeList, HeaderNames.MimeType.APPLICATION_VND_ATOMIKOS_JSON))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,8 @@ public int prepare () throws RollbackException,
// If a recursive prepare re-enters, then it will see a voting state -> reject.
// Note that this may also avoid some legal prepares, but only rarely
if ( getState ().equals ( TxState.PREPARING ) )
throw new RollbackException ( "Recursion detected" );
return Participant.READ_ONLY;
//throw new RollbackException ( "Recursion detected" );

int ret = Participant.READ_ONLY + 1;
synchronized ( fsm_ ) {
Expand Down