From d42cc149db7f960575eff168d6ed6955000ef78f Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Sun, 15 Nov 2015 13:36:12 +0100 Subject: [PATCH] Declared JDBC operation compiled flag as volatile Issue: SPR-13617 (cherry picked from commit 0f4e4fc) --- .../springframework/jdbc/core/simple/AbstractJdbcCall.java | 6 +++--- .../jdbc/core/simple/AbstractJdbcInsert.java | 6 +++--- .../org/springframework/jdbc/object/RdbmsOperation.java | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/AbstractJdbcCall.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/AbstractJdbcCall.java index 992c19c92d7..8971016a5c6 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/AbstractJdbcCall.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/AbstractJdbcCall.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2015 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. @@ -67,7 +67,7 @@ public abstract class AbstractJdbcCall { * Has this operation been compiled? Compilation means at least checking * that a DataSource or JdbcTemplate has been provided. */ - private boolean compiled = false; + private volatile boolean compiled = false; /** The generated string used for call statement */ private String callString; @@ -323,7 +323,7 @@ public abstract class AbstractJdbcCall { /** * Is this operation "compiled"? - * @return whether this operation is compiled, and ready to use. + * @return whether this operation is compiled and ready to use */ public boolean isCompiled() { return this.compiled; diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/AbstractJdbcInsert.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/AbstractJdbcInsert.java index e71129b13f6..62d055f693b 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/AbstractJdbcInsert.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/AbstractJdbcInsert.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2015 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. @@ -80,7 +80,7 @@ public abstract class AbstractJdbcInsert { * Has this operation been compiled? Compilation means at least checking * that a DataSource or JdbcTemplate has been provided. */ - private boolean compiled = false; + private volatile boolean compiled = false; /** The generated string used for insert statement */ private String insertString; @@ -296,7 +296,7 @@ public abstract class AbstractJdbcInsert { /** * Is this operation "compiled"? - * @return whether this operation is compiled, and ready to use. + * @return whether this operation is compiled and ready to use */ public boolean isCompiled() { return this.compiled; diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/object/RdbmsOperation.java b/spring-jdbc/src/main/java/org/springframework/jdbc/object/RdbmsOperation.java index 263e9d1287c..f5646730dd6 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/object/RdbmsOperation.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/object/RdbmsOperation.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2015 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. @@ -81,7 +81,7 @@ public abstract class RdbmsOperation implements InitializingBean { * least checking that a DataSource and sql have been provided, * but subclasses may also implement their own custom validation. */ - private boolean compiled; + private volatile boolean compiled; /** @@ -349,7 +349,7 @@ public abstract class RdbmsOperation implements InitializingBean { * Is this operation "compiled"? Compilation, as in JDO, * means that the operation is fully configured, and ready to use. * The exact meaning of compilation will vary between subclasses. - * @return whether this operation is compiled, and ready to use. + * @return whether this operation is compiled and ready to use */ public boolean isCompiled() { return this.compiled;