@@ -227,10 +227,11 @@ public class SQLServerConnection implements ISQLServerConnection, java.io.Serial
227227 * lock instance for "this"
228228 **/
229229 private final Lock lock = new ReentrantLock ();
230+
230231 /**
231232 * static lock instance for the class
232233 **/
233- private static final Lock LOCK = new ReentrantLock ();
234+ private static final Lock sLock = new ReentrantLock ();
234235
235236 /**
236237 * Return an existing cached SharedTimer associated with this Connection or create a new one.
@@ -947,7 +948,7 @@ public static void registerColumnEncryptionKeyStoreProviders(
947948 loggerExternal .entering (loggingClassNameBase , "registerColumnEncryptionKeyStoreProviders" ,
948949 "Registering Column Encryption Key Store Providers" );
949950
950- LOCK .lock ();
951+ sLock .lock ();
951952 try {
952953 if (null == clientKeyStoreProviders ) {
953954 throw new SQLServerException (null , SQLServerException .getErrString ("R_CustomKeyStoreProviderMapNull" ),
@@ -988,7 +989,7 @@ public static void registerColumnEncryptionKeyStoreProviders(
988989 globalCustomColumnEncryptionKeyStoreProviders .put (providerName , provider );
989990 }
990991 } finally {
991- LOCK .unlock ();
992+ sLock .unlock ();
992993 }
993994
994995 loggerExternal .exiting (loggingClassNameBase , "registerColumnEncryptionKeyStoreProviders" ,
@@ -1004,14 +1005,14 @@ public static void unregisterColumnEncryptionKeyStoreProviders() {
10041005 loggerExternal .entering (loggingClassNameBase , "unregisterColumnEncryptionKeyStoreProviders" ,
10051006 "Removing Column Encryption Key Store Provider" );
10061007
1007- LOCK .lock ();
1008+ sLock .lock ();
10081009 try {
10091010 if (null != globalCustomColumnEncryptionKeyStoreProviders ) {
10101011 globalCustomColumnEncryptionKeyStoreProviders .clear ();
10111012 globalCustomColumnEncryptionKeyStoreProviders = null ;
10121013 }
10131014 } finally {
1014- LOCK .unlock ();
1015+ sLock .unlock ();
10151016 }
10161017
10171018 loggerExternal .exiting (loggingClassNameBase , "unregisterColumnEncryptionKeyStoreProviders" ,
@@ -1233,15 +1234,15 @@ public static void setColumnEncryptionTrustedMasterKeyPaths(Map<String, List<Str
12331234 loggerExternal .entering (loggingClassNameBase , "setColumnEncryptionTrustedMasterKeyPaths" ,
12341235 "Setting Trusted Master Key Paths" );
12351236
1236- LOCK .lock ();
1237+ sLock .lock ();
12371238 try {
12381239 // Use upper case for server and instance names.
12391240 columnEncryptionTrustedMasterKeyPaths .clear ();
12401241 for (Map .Entry <String , List <String >> entry : trustedKeyPaths .entrySet ()) {
12411242 columnEncryptionTrustedMasterKeyPaths .put (entry .getKey ().toUpperCase (), entry .getValue ());
12421243 }
12431244 } finally {
1244- LOCK .unlock ();
1245+ sLock .unlock ();
12451246 }
12461247
12471248 loggerExternal .exiting (loggingClassNameBase , "setColumnEncryptionTrustedMasterKeyPaths" ,
@@ -1260,12 +1261,12 @@ public static void updateColumnEncryptionTrustedMasterKeyPaths(String server, Li
12601261 loggerExternal .entering (loggingClassNameBase , "updateColumnEncryptionTrustedMasterKeyPaths" ,
12611262 "Updating Trusted Master Key Paths" );
12621263
1263- LOCK .lock ();
1264+ sLock .lock ();
12641265 try {
12651266 // Use upper case for server and instance names.
12661267 columnEncryptionTrustedMasterKeyPaths .put (server .toUpperCase (), trustedKeyPaths );
12671268 } finally {
1268- LOCK .unlock ();
1269+ sLock .unlock ();
12691270 }
12701271
12711272 loggerExternal .exiting (loggingClassNameBase , "updateColumnEncryptionTrustedMasterKeyPaths" ,
@@ -1282,12 +1283,12 @@ public static void removeColumnEncryptionTrustedMasterKeyPaths(String server) {
12821283 loggerExternal .entering (loggingClassNameBase , "removeColumnEncryptionTrustedMasterKeyPaths" ,
12831284 "Removing Trusted Master Key Paths" );
12841285
1285- LOCK .lock ();
1286+ sLock .lock ();
12861287 try {
12871288 // Use upper case for server and instance names.
12881289 columnEncryptionTrustedMasterKeyPaths .remove (server .toUpperCase ());
12891290 } finally {
1290- LOCK .unlock ();
1291+ sLock .unlock ();
12911292 }
12921293
12931294 loggerExternal .exiting (loggingClassNameBase , "removeColumnEncryptionTrustedMasterKeyPaths" ,
@@ -1303,7 +1304,7 @@ public static Map<String, List<String>> getColumnEncryptionTrustedMasterKeyPaths
13031304 loggerExternal .entering (loggingClassNameBase , "getColumnEncryptionTrustedMasterKeyPaths" ,
13041305 "Getting Trusted Master Key Paths" );
13051306
1306- LOCK .lock ();
1307+ sLock .lock ();
13071308 try {
13081309 Map <String , List <String >> masterKeyPathCopy = new HashMap <>();
13091310
@@ -1316,12 +1317,12 @@ public static Map<String, List<String>> getColumnEncryptionTrustedMasterKeyPaths
13161317
13171318 return masterKeyPathCopy ;
13181319 } finally {
1319- LOCK .unlock ();
1320+ sLock .unlock ();
13201321 }
13211322 }
13221323
13231324 static List <String > getColumnEncryptionTrustedMasterKeyPaths (String server , Boolean [] hasEntry ) {
1324- LOCK .lock ();
1325+ sLock .lock ();
13251326 try {
13261327 if (columnEncryptionTrustedMasterKeyPaths .containsKey (server )) {
13271328 hasEntry [0 ] = true ;
@@ -1331,7 +1332,7 @@ static List<String> getColumnEncryptionTrustedMasterKeyPaths(String server, Bool
13311332 return null ;
13321333 }
13331334 } finally {
1334- LOCK .unlock ();
1335+ sLock .unlock ();
13351336 }
13361337 }
13371338
@@ -1340,11 +1341,11 @@ static List<String> getColumnEncryptionTrustedMasterKeyPaths(String server, Bool
13401341 * request to acquire an access token.
13411342 */
13421343 public static void clearUserTokenCache () {
1343- LOCK .lock ();
1344+ sLock .lock ();
13441345 try {
13451346 PersistentTokenCacheAccessAspect .clearUserTokenCache ();
13461347 } finally {
1347- LOCK .unlock ();
1348+ sLock .unlock ();
13481349 }
13491350 }
13501351
@@ -7478,7 +7479,7 @@ void doSecurityCheck() {
74787479 */
74797480 public static void setColumnEncryptionKeyCacheTtl (int columnEncryptionKeyCacheTTL ,
74807481 TimeUnit unit ) throws SQLServerException {
7481- LOCK .lock ();
7482+ sLock .lock ();
74827483 try {
74837484 if (columnEncryptionKeyCacheTTL < 0 || unit .equals (TimeUnit .MILLISECONDS )
74847485 || unit .equals (TimeUnit .MICROSECONDS ) || unit .equals (TimeUnit .NANOSECONDS )) {
@@ -7488,16 +7489,16 @@ public static void setColumnEncryptionKeyCacheTtl(int columnEncryptionKeyCacheTT
74887489
74897490 columnEncryptionKeyCacheTtl = TimeUnit .SECONDS .convert (columnEncryptionKeyCacheTTL , unit );
74907491 } finally {
7491- LOCK .unlock ();
7492+ sLock .unlock ();
74927493 }
74937494 }
74947495
74957496 static long getColumnEncryptionKeyCacheTtl () {
7496- LOCK .lock ();
7497+ sLock .lock ();
74977498 try {
74987499 return columnEncryptionKeyCacheTtl ;
74997500 } finally {
7500- LOCK .unlock ();
7501+ sLock .unlock ();
75017502 }
75027503 }
75037504
0 commit comments