Skip to content

Commit

Permalink
JBTM-2623 JBTM-2653 GlassFish to Narayana interoperability
Browse files Browse the repository at this point in the history
  • Loading branch information
mmusgrov committed Mar 31, 2017
1 parent 2c83189 commit 4166483
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
Expand Up @@ -89,7 +89,9 @@
public class ServerTopLevelAction extends ServerResource implements org.omg.CosTransactions.ResourceOperations
{

public ServerTopLevelAction (ServerControl control)
protected boolean _registered;

public ServerTopLevelAction (ServerControl control)
{
super(control);

Expand Down Expand Up @@ -130,6 +132,7 @@ public ServerTopLevelAction (ServerControl control)
}
else
_valid = false;
_registered = false;
}

public Resource getReference ()
Expand Down Expand Up @@ -591,6 +594,9 @@ protected boolean registerResource (Coordinator theCoordinator)

if (theCoordinator != null)
{
if (_registered)
return true;

try
{
/*
Expand All @@ -600,6 +606,8 @@ protected boolean registerResource (Coordinator theCoordinator)

RecoveryCoordinator recoveryCoord = theCoordinator.register_resource(_resourceRef);

_registered = true;

if (!_theControl.isWrapper())
{
ServerTransaction tx = (ServerTransaction) _theControl.getImplHandle();
Expand Down
Expand Up @@ -53,8 +53,7 @@ public ServerStrictTopLevelAction (ServerControl control, boolean doRegister)
jtsLogger.logger.trace("ServerStrictTopLevelAction::ServerStrictTopLevelAction (ServerControl, " + doRegister + " )");
}

_registered = false;
_theResource = null;
_theResource = null;

if (_theControl != null)
{
Expand Down Expand Up @@ -110,6 +109,4 @@ public String type ()
return "/Resources/Arjuna/ServerTopLevelAction/ServerStrictTopLevelAction";
}

private boolean _registered;

}
3 changes: 2 additions & 1 deletion ArjunaJTS/jts/classes/com/arjuna/ats/jts/OTSManager.java
Expand Up @@ -31,6 +31,7 @@

package com.arjuna.ats.jts;

import com.arjuna.ats.jts.common.jtsPropertyManager;
import org.omg.CORBA.BAD_PARAM;
import org.omg.CORBA.SystemException;
import org.omg.CosTransactions.Control;
Expand Down Expand Up @@ -315,7 +316,7 @@ public static final void setPOA (com.arjuna.orbportability.OA thePoa)
com.arjuna.ats.internal.jts.ORBManager.setPOA(thePoa);
}

public static final int serviceId = 0xDEADBEEF;
public static final int serviceId = jtsPropertyManager.getJTSEnvironmentBean().getTransactionServiceId();

private static int _localSlotId = -1;
private static int _receivedSlotId = -1;
Expand Down
Expand Up @@ -54,6 +54,7 @@ public class JTSEnvironmentBean implements JTSEnvironmentBeanMBean

@FullPropertyName(name = "com.arjuna.ats.jts.recovery.commitTransactionRetryLimit")
private volatile int commitedTransactionRetryLimit = 3;
private volatile int transactionServiceId = 0xDEADBEEF;


/**
Expand Down Expand Up @@ -415,4 +416,12 @@ public void setCommitedTransactionRetryLimit(int commitedTransactionRetryLimit)
{
this.commitedTransactionRetryLimit = commitedTransactionRetryLimit;
}

public int getTransactionServiceId() {
return transactionServiceId;
}

public void setTransactionServiceId(int transactionServiceId) {
this.transactionServiceId = transactionServiceId;
}
}

0 comments on commit 4166483

Please sign in to comment.