From 81342f14d42182e20449bca45d64351f98cdb8a0 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Wed, 28 Oct 2015 14:28:32 +0100 Subject: [PATCH] Declared JDBC operation compiled flag as volatile Issue: SPR-13617 --- .../springframework/jdbc/core/simple/AbstractJdbcCall.java | 4 ++-- .../jdbc/core/simple/AbstractJdbcInsert.java | 6 +++--- .../org/springframework/jdbc/object/RdbmsOperation.java | 6 +++--- 3 files changed, 8 insertions(+), 8 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 1b5f9697e2..5208267898 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 @@ -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; @@ -329,7 +329,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 e7b7d2fa51..3af9f4635a 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 61c5233894..7392219062 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; /** @@ -350,7 +350,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;