Skip to content

Commit

Permalink
Merge pull request #27795 from jmstephensgit/remove_unused_code_from_…
Browse files Browse the repository at this point in the history
…mcwrapper

remove unused code from mcwrapper class
  • Loading branch information
jmstephensgit committed Mar 1, 2024
2 parents be20a75 + 33cc14c commit 83bbd87
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 220 deletions.
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 1997, 2023 IBM Corporation and others.
* Copyright (c) 1997, 2024 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -386,11 +386,7 @@ private static class J2CLock {
private final VetoableChangeSupport vChangeSupport = new VetoableChangeSupport(this);
protected Properties raMetaDataProps = null;
protected Properties dsMetaDataProps = null;
public boolean callResourceAdapterStatMethods = false;
public int numberOfInuseConnections = 0;
public transient Object numberOfInuseConnectionsLockObject = new J2CLock();
public int numberOfFreeConnections = 0;
public transient Object numberOfFreeConnectionsLockObject = new J2CLock();

protected transient Integer maxNumberOfMCsAllowableInThread = null;
private transient boolean parkIfDissociateUnavailable;
protected transient Boolean throwExceptionOnMCThreadCheck = null;
Expand Down
215 changes: 1 addition & 214 deletions dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/MCWrapper.java
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 1997, 2023 IBM Corporation and others.
* Copyright (c) 1997, 2024 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -2685,219 +2685,6 @@ public int getPoolState() {
*/
@Override
public void setPoolState(int i) {
if (pm.gConfigProps.callResourceAdapterStatMethods) {
if (poolState.get() == 0) {
/*
* If current state is 0, we are a new connection, or we are in
* transition to one of the pools.
*/
if (i == 1) {
/*
* This connection is moving from new/transaction to free
*/
synchronized (pm.gConfigProps.numberOfFreeConnectionsLockObject) {
++pm.gConfigProps.numberOfFreeConnections;
}
}
if (i == 2) {
/*
* This connection is moving from new/transaction to shared
*/
synchronized (pm.gConfigProps.numberOfInuseConnectionsLockObject) {
++pm.gConfigProps.numberOfInuseConnections;
}
}
if (i == 3) {
/*
* This connection is moving from new/transaction to unshared
*/
synchronized (pm.gConfigProps.numberOfInuseConnectionsLockObject) {
++pm.gConfigProps.numberOfInuseConnections;
}
}
if (i == 4) {
/*
* This connection is moving from new/transaction to waiter
*/
// do nothing here
//++pm.gConfigProps.numberOfInuseConnections;
}
}
if (poolState.get() == 1) {
/*
* We are in the free pool, moving to inuse.
*/
if (i == 0) {
/*
* This connection is moving from free to transition
*/
synchronized (pm.gConfigProps.numberOfFreeConnectionsLockObject) {
--pm.gConfigProps.numberOfFreeConnections;
}
}
if (i == 2) {
/*
* This connection is moving from free to shared
*/
synchronized (pm.gConfigProps.numberOfFreeConnectionsLockObject) {
--pm.gConfigProps.numberOfFreeConnections;
}
synchronized (pm.gConfigProps.numberOfInuseConnectionsLockObject) {
++pm.gConfigProps.numberOfInuseConnections;
}
}
if (i == 3) {
/*
* This connection is moving from free to unshared
*/
synchronized (pm.gConfigProps.numberOfFreeConnectionsLockObject) {
--pm.gConfigProps.numberOfFreeConnections;
}
synchronized (pm.gConfigProps.numberOfInuseConnectionsLockObject) {
++pm.gConfigProps.numberOfInuseConnections;
}
}
if (i == 4) {
/*
* This connection is moving from free to waiter
*/
synchronized (pm.gConfigProps.numberOfFreeConnectionsLockObject) {
--pm.gConfigProps.numberOfFreeConnections;
}
//--pm.gConfigProps.numberOfFreeConnections;
//++pm.gConfigProps.numberOfInuseConnections;
}

}
if (poolState.get() == 2) {
/*
* We are in the shared pool, moving to free/transition.
*/
if (i == 0) {
/*
* This connection is moving from shared to transition
*/
synchronized (pm.gConfigProps.numberOfInuseConnectionsLockObject) {
--pm.gConfigProps.numberOfInuseConnections;
}
}
if (i == 1) {
/*
* This connection is moving from shared to free
*/
synchronized (pm.gConfigProps.numberOfFreeConnectionsLockObject) {
++pm.gConfigProps.numberOfFreeConnections;
}
synchronized (pm.gConfigProps.numberOfInuseConnectionsLockObject) {
--pm.gConfigProps.numberOfInuseConnections;
}
}
if (i == 3) {
/*
* This connection is moving from shared to unshared
*/
// do nothing
//--pm.gConfigProps.numberOfFreeConnections;
//++pm.gConfigProps.numberOfInuseConnections;
}
if (i == 4) {
/*
* This connection is moving from shared to waiter
*/
synchronized (pm.gConfigProps.numberOfInuseConnectionsLockObject) {
--pm.gConfigProps.numberOfInuseConnections;
}
//--pm.gConfigProps.numberOfFreeConnections;
//++pm.gConfigProps.numberOfInuseConnections;
}

}
if (poolState.get() == 3) {
/*
* We are in the unshared pool, moving to free/transition.
*/
if (i == 0) {
/*
* This connection is moving from unshared to transition
*/
synchronized (pm.gConfigProps.numberOfInuseConnectionsLockObject) {
--pm.gConfigProps.numberOfInuseConnections;
}
}
if (i == 1) {
/*
* This connection is moving from unshared to free
*/
synchronized (pm.gConfigProps.numberOfFreeConnectionsLockObject) {
++pm.gConfigProps.numberOfFreeConnections;
}
synchronized (pm.gConfigProps.numberOfInuseConnectionsLockObject) {
--pm.gConfigProps.numberOfInuseConnections;
}
}
if (i == 2) {
/*
* This connection is moving from unshared to shared
*/
// do nothing
//--pm.gConfigProps.numberOfFreeConnections;
//++pm.gConfigProps.numberOfInuseConnections;
}
if (i == 4) {
/*
* This connection is moving from unshared to waiter
*/
synchronized (pm.gConfigProps.numberOfInuseConnectionsLockObject) {
--pm.gConfigProps.numberOfInuseConnections;
}
//--pm.gConfigProps.numberOfFreeConnections;
//++pm.gConfigProps.numberOfInuseConnections;
}

}
if (poolState.get() == 4) {
/*
* We are in the waiter pool, moving to free/transition.
*/
if (i == 0) {
/*
* This connection is moving from waiter to transition
*/
// do nothing
//--pm.gConfigProps.numberOfInuseConnections;
}
if (i == 1) {
/*
* This connection is moving from waiter to free
*/
synchronized (pm.gConfigProps.numberOfFreeConnectionsLockObject) {
++pm.gConfigProps.numberOfFreeConnections;
}
//--pm.gConfigProps.numberOfInuseConnections;
}
if (i == 2) {
/*
* This connection is moving from waiter to shared
*/
// do nothing
//--pm.gConfigProps.numberOfFreeConnections;
synchronized (pm.gConfigProps.numberOfInuseConnectionsLockObject) {
++pm.gConfigProps.numberOfInuseConnections;
}
}
if (i == 3) {
/*
* This connection is moving from waiter to unshared
*/
// do nothing here
//--pm.gConfigProps.numberOfFreeConnections;
synchronized (pm.gConfigProps.numberOfInuseConnectionsLockObject) {
++pm.gConfigProps.numberOfInuseConnections;
}
}
}

}
poolState.set(i);
}

Expand Down

0 comments on commit 83bbd87

Please sign in to comment.