Skip to content

Commit

Permalink
EE-6797: Bitronix exception when redeploying an app using XA (scalar-…
Browse files Browse the repository at this point in the history
…labs#12)

transactions
  • Loading branch information
elrodro83 authored Jun 6, 2019
1 parent aa5727d commit 6bd0508
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
5 changes: 2 additions & 3 deletions btm/src/main/java/bitronix/tm/BitronixTransactionManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ public class BitronixTransactionManager implements TransactionManager, UserTrans
private final static Logger log = LoggerFactory.getLogger(BitronixTransactionManager.class);
private final static String MDC_GTRID_KEY = "btm-gtrid";

private final Map<Thread, ThreadContext> contexts = new ConcurrentHashMap<Thread, ThreadContext>(128, 0.75f, 128);
private final Map<Uid, BitronixTransaction> inFlightTransactions = new ConcurrentHashMap<Uid, BitronixTransaction>(128, 0.75f, 128);
private final Map<Thread, ThreadContext> contexts = new ConcurrentHashMap<>(128, 0.75f, 128);
private final Map<Uid, BitronixTransaction> inFlightTransactions = new ConcurrentHashMap<>(128, 0.75f, 128);

private volatile boolean shuttingDown;

Expand All @@ -80,7 +80,6 @@ public BitronixTransactionManager() {
shuttingDown = false;
logVersion();
Configuration configuration = TransactionManagerServices.getConfiguration();
configuration.setDisableJmx(true);
configuration.buildServerIdArray(); // first call will initialize the ServerId

if (log.isDebugEnabled()) log.debug("starting BitronixTransactionManager using " + configuration);
Expand Down
10 changes: 9 additions & 1 deletion btm/src/main/java/bitronix/tm/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@
*/
package bitronix.tm;

import bitronix.tm.utils.*;
import bitronix.tm.utils.InitializationException;
import bitronix.tm.utils.PropertyException;
import bitronix.tm.utils.PropertyUtils;
import bitronix.tm.utils.Service;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -424,6 +428,7 @@ public Configuration setGracefulShutdownInterval(int gracefulShutdownInterval) {
* @return the interval in minutes.
* @deprecated superceded by #getBackgroundRecoveryIntervalSeconds().
*/
@Deprecated
public int getBackgroundRecoveryInterval() {
return getBackgroundRecoveryIntervalSeconds() / 60;
}
Expand All @@ -435,6 +440,7 @@ public int getBackgroundRecoveryInterval() {
* @deprecated superceded by #setBackgroundRecoveryIntervalSeconds(int).
* @return this.
*/
@Deprecated
public Configuration setBackgroundRecoveryInterval(int backgroundRecoveryInterval) {
log.warn("setBackgroundRecoveryInterval() is deprecated, consider using setBackgroundRecoveryIntervalSeconds() instead.");
setBackgroundRecoveryIntervalSeconds(backgroundRecoveryInterval * 60);
Expand Down Expand Up @@ -671,10 +677,12 @@ public byte[] buildServerIdArray() {
return serverIdArray;
}

@Override
public void shutdown() {
serverIdArray = null;
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder(512);
sb.append("a Configuration with [");
Expand Down

0 comments on commit 6bd0508

Please sign in to comment.