From 09f02bc620fbc1d8e7b753097e0a280b7858c8f9 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Tue, 23 Feb 2010 10:47:51 +0000 Subject: [PATCH] use WeakHashMap for DataSource-keyed cache (SPR-6887) --- .../springframework/jdbc/support/SQLErrorCodesFactory.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/SQLErrorCodesFactory.java b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/SQLErrorCodesFactory.java index 9b6a05fa4e2..66571904555 100644 --- a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/SQLErrorCodesFactory.java +++ b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/SQLErrorCodesFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2010 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,8 +17,8 @@ package org.springframework.jdbc.support; import java.util.Collections; -import java.util.HashMap; import java.util.Map; +import java.util.WeakHashMap; import javax.sql.DataSource; import org.apache.commons.logging.Log; @@ -85,7 +85,7 @@ public class SQLErrorCodesFactory { /** * Map to cache the SQLErrorCodes instance per DataSource. */ - private final Map dataSourceCache = new HashMap(16); + private final Map dataSourceCache = new WeakHashMap(16); /**