From 473061ec1ebe7404fe8221cb8652b07a0f12dc66 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Fri, 28 Feb 2014 19:00:31 +0100 Subject: [PATCH] Added explicit note on thread safety to JdbcTemplate variants Issue: SPR-11478 --- .../java/org/springframework/jdbc/core/JdbcTemplate.java | 2 ++ .../jdbc/core/namedparam/NamedParameterJdbcTemplate.java | 4 +++- .../jdbc/core/simple/SimpleJdbcTemplate.java | 7 ++++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/JdbcTemplate.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/JdbcTemplate.java index fc2d29dfb7..d1cfd94c61 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/JdbcTemplate.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/JdbcTemplate.java @@ -81,6 +81,8 @@ import org.springframework.util.StringUtils; *

All SQL operations performed by this class are logged at debug level, * using "org.springframework.jdbc.core.JdbcTemplate" as log category. * + *

NOTE: An instance of this class is thread-safe once configured. + * * @author Rod Johnson * @author Juergen Hoeller * @author Thomas Risberg diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/namedparam/NamedParameterJdbcTemplate.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/namedparam/NamedParameterJdbcTemplate.java index 593e231511..ff59b02051 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/namedparam/NamedParameterJdbcTemplate.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/namedparam/NamedParameterJdbcTemplate.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -52,6 +52,8 @@ import org.springframework.util.Assert; * exposed to allow for convenient access to the traditional * {@link org.springframework.jdbc.core.JdbcTemplate} methods. * + *

NOTE: An instance of this class is thread-safe once configured. + * * @author Thomas Risberg * @author Juergen Hoeller * @since 2.0 diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/SimpleJdbcTemplate.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/SimpleJdbcTemplate.java index 78e85682bd..f947df5810 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/SimpleJdbcTemplate.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/SimpleJdbcTemplate.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2014 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. @@ -18,13 +18,12 @@ package org.springframework.jdbc.core.simple; import java.util.List; import java.util.Map; - import javax.sql.DataSource; import org.springframework.dao.DataAccessException; +import org.springframework.jdbc.core.BatchUpdateUtils; import org.springframework.jdbc.core.JdbcOperations; import org.springframework.jdbc.core.RowMapper; -import org.springframework.jdbc.core.BatchUpdateUtils; import org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations; import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; import org.springframework.jdbc.core.namedparam.SqlParameterSource; @@ -42,6 +41,8 @@ import org.springframework.util.ObjectUtils; * such as RowCallbackHandler, updates with PreparedStatementSetters rather than * argument arrays, and stored procedures as well as batch operations. * + *

NOTE: An instance of this class is thread-safe once configured. + * * @author Rod Johnson * @author Rob Harrop * @author Juergen Hoeller