@@ -218,10 +218,11 @@ public class SQLServerConnection implements ISQLServerConnection, java.io.Serial
218218 * lock instance for "this"
219219 **/
220220 private final Lock lock = new ReentrantLock ();
221+
221222 /**
222223 * static lock instance for the class
223224 **/
224- private static final Lock LOCK = new ReentrantLock ();
225+ private static final Lock sLock = new ReentrantLock ();
225226
226227 /**
227228 * Return an existing cached SharedTimer associated with this Connection or create a new one.
@@ -938,7 +939,7 @@ public static void registerColumnEncryptionKeyStoreProviders(
938939 loggerExternal .entering (loggingClassNameBase , "registerColumnEncryptionKeyStoreProviders" ,
939940 "Registering Column Encryption Key Store Providers" );
940941
941- LOCK .lock ();
942+ sLock .lock ();
942943 try {
943944 if (null == clientKeyStoreProviders ) {
944945 throw new SQLServerException (null , SQLServerException .getErrString ("R_CustomKeyStoreProviderMapNull" ),
@@ -979,7 +980,7 @@ public static void registerColumnEncryptionKeyStoreProviders(
979980 globalCustomColumnEncryptionKeyStoreProviders .put (providerName , provider );
980981 }
981982 } finally {
982- LOCK .unlock ();
983+ sLock .unlock ();
983984 }
984985
985986 loggerExternal .exiting (loggingClassNameBase , "registerColumnEncryptionKeyStoreProviders" ,
@@ -995,14 +996,14 @@ public static void unregisterColumnEncryptionKeyStoreProviders() {
995996 loggerExternal .entering (loggingClassNameBase , "unregisterColumnEncryptionKeyStoreProviders" ,
996997 "Removing Column Encryption Key Store Provider" );
997998
998- LOCK .lock ();
999+ sLock .lock ();
9991000 try {
10001001 if (null != globalCustomColumnEncryptionKeyStoreProviders ) {
10011002 globalCustomColumnEncryptionKeyStoreProviders .clear ();
10021003 globalCustomColumnEncryptionKeyStoreProviders = null ;
10031004 }
10041005 } finally {
1005- LOCK .unlock ();
1006+ sLock .unlock ();
10061007 }
10071008
10081009 loggerExternal .exiting (loggingClassNameBase , "unregisterColumnEncryptionKeyStoreProviders" ,
@@ -1224,15 +1225,15 @@ public static void setColumnEncryptionTrustedMasterKeyPaths(Map<String, List<Str
12241225 loggerExternal .entering (loggingClassNameBase , "setColumnEncryptionTrustedMasterKeyPaths" ,
12251226 "Setting Trusted Master Key Paths" );
12261227
1227- LOCK .lock ();
1228+ sLock .lock ();
12281229 try {
12291230 // Use upper case for server and instance names.
12301231 columnEncryptionTrustedMasterKeyPaths .clear ();
12311232 for (Map .Entry <String , List <String >> entry : trustedKeyPaths .entrySet ()) {
12321233 columnEncryptionTrustedMasterKeyPaths .put (entry .getKey ().toUpperCase (), entry .getValue ());
12331234 }
12341235 } finally {
1235- LOCK .unlock ();
1236+ sLock .unlock ();
12361237 }
12371238
12381239 loggerExternal .exiting (loggingClassNameBase , "setColumnEncryptionTrustedMasterKeyPaths" ,
@@ -1251,12 +1252,12 @@ public static void updateColumnEncryptionTrustedMasterKeyPaths(String server, Li
12511252 loggerExternal .entering (loggingClassNameBase , "updateColumnEncryptionTrustedMasterKeyPaths" ,
12521253 "Updating Trusted Master Key Paths" );
12531254
1254- LOCK .lock ();
1255+ sLock .lock ();
12551256 try {
12561257 // Use upper case for server and instance names.
12571258 columnEncryptionTrustedMasterKeyPaths .put (server .toUpperCase (), trustedKeyPaths );
12581259 } finally {
1259- LOCK .unlock ();
1260+ sLock .unlock ();
12601261 }
12611262
12621263 loggerExternal .exiting (loggingClassNameBase , "updateColumnEncryptionTrustedMasterKeyPaths" ,
@@ -1273,12 +1274,12 @@ public static void removeColumnEncryptionTrustedMasterKeyPaths(String server) {
12731274 loggerExternal .entering (loggingClassNameBase , "removeColumnEncryptionTrustedMasterKeyPaths" ,
12741275 "Removing Trusted Master Key Paths" );
12751276
1276- LOCK .lock ();
1277+ sLock .lock ();
12771278 try {
12781279 // Use upper case for server and instance names.
12791280 columnEncryptionTrustedMasterKeyPaths .remove (server .toUpperCase ());
12801281 } finally {
1281- LOCK .unlock ();
1282+ sLock .unlock ();
12821283 }
12831284
12841285 loggerExternal .exiting (loggingClassNameBase , "removeColumnEncryptionTrustedMasterKeyPaths" ,
@@ -1294,7 +1295,7 @@ public static Map<String, List<String>> getColumnEncryptionTrustedMasterKeyPaths
12941295 loggerExternal .entering (loggingClassNameBase , "getColumnEncryptionTrustedMasterKeyPaths" ,
12951296 "Getting Trusted Master Key Paths" );
12961297
1297- LOCK .lock ();
1298+ sLock .lock ();
12981299 try {
12991300 Map <String , List <String >> masterKeyPathCopy = new HashMap <>();
13001301
@@ -1307,12 +1308,12 @@ public static Map<String, List<String>> getColumnEncryptionTrustedMasterKeyPaths
13071308
13081309 return masterKeyPathCopy ;
13091310 } finally {
1310- LOCK .unlock ();
1311+ sLock .unlock ();
13111312 }
13121313 }
13131314
13141315 static List <String > getColumnEncryptionTrustedMasterKeyPaths (String server , Boolean [] hasEntry ) {
1315- LOCK .lock ();
1316+ sLock .lock ();
13161317 try {
13171318 if (columnEncryptionTrustedMasterKeyPaths .containsKey (server )) {
13181319 hasEntry [0 ] = true ;
@@ -1322,7 +1323,7 @@ static List<String> getColumnEncryptionTrustedMasterKeyPaths(String server, Bool
13221323 return null ;
13231324 }
13241325 } finally {
1325- LOCK .unlock ();
1326+ sLock .unlock ();
13261327 }
13271328 }
13281329
@@ -1331,11 +1332,11 @@ static List<String> getColumnEncryptionTrustedMasterKeyPaths(String server, Bool
13311332 * request to acquire an access token.
13321333 */
13331334 public static void clearUserTokenCache () {
1334- LOCK .lock ();
1335+ sLock .lock ();
13351336 try {
13361337 PersistentTokenCacheAccessAspect .clearUserTokenCache ();
13371338 } finally {
1338- LOCK .unlock ();
1339+ sLock .unlock ();
13391340 }
13401341 }
13411342
@@ -7469,7 +7470,7 @@ void doSecurityCheck() {
74697470 */
74707471 public static void setColumnEncryptionKeyCacheTtl (int columnEncryptionKeyCacheTTL ,
74717472 TimeUnit unit ) throws SQLServerException {
7472- LOCK .lock ();
7473+ sLock .lock ();
74737474 try {
74747475 if (columnEncryptionKeyCacheTTL < 0 || unit .equals (TimeUnit .MILLISECONDS )
74757476 || unit .equals (TimeUnit .MICROSECONDS ) || unit .equals (TimeUnit .NANOSECONDS )) {
@@ -7479,16 +7480,16 @@ public static void setColumnEncryptionKeyCacheTtl(int columnEncryptionKeyCacheTT
74797480
74807481 columnEncryptionKeyCacheTtl = TimeUnit .SECONDS .convert (columnEncryptionKeyCacheTTL , unit );
74817482 } finally {
7482- LOCK .unlock ();
7483+ sLock .unlock ();
74837484 }
74847485 }
74857486
74867487 static long getColumnEncryptionKeyCacheTtl () {
7487- LOCK .lock ();
7488+ sLock .lock ();
74887489 try {
74897490 return columnEncryptionKeyCacheTtl ;
74907491 } finally {
7491- LOCK .unlock ();
7492+ sLock .unlock ();
74927493 }
74937494 }
74947495
0 commit comments