Skip to content

Commit d42cc14

Browse files
committed
Declared JDBC operation compiled flag as volatile
Issue: SPR-13617 (cherry picked from commit 0f4e4fc)
1 parent 86ba747 commit d42cc14

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/AbstractJdbcCall.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -67,7 +67,7 @@ public abstract class AbstractJdbcCall {
6767
* Has this operation been compiled? Compilation means at least checking
6868
* that a DataSource or JdbcTemplate has been provided.
6969
*/
70-
private boolean compiled = false;
70+
private volatile boolean compiled = false;
7171

7272
/** The generated string used for call statement */
7373
private String callString;
@@ -323,7 +323,7 @@ protected void onCompileInternal() {
323323

324324
/**
325325
* Is this operation "compiled"?
326-
* @return whether this operation is compiled, and ready to use.
326+
* @return whether this operation is compiled and ready to use
327327
*/
328328
public boolean isCompiled() {
329329
return this.compiled;

spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/AbstractJdbcInsert.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -80,7 +80,7 @@ public abstract class AbstractJdbcInsert {
8080
* Has this operation been compiled? Compilation means at least checking
8181
* that a DataSource or JdbcTemplate has been provided.
8282
*/
83-
private boolean compiled = false;
83+
private volatile boolean compiled = false;
8484

8585
/** The generated string used for insert statement */
8686
private String insertString;
@@ -296,7 +296,7 @@ protected void onCompileInternal() {
296296

297297
/**
298298
* Is this operation "compiled"?
299-
* @return whether this operation is compiled, and ready to use.
299+
* @return whether this operation is compiled and ready to use
300300
*/
301301
public boolean isCompiled() {
302302
return this.compiled;

spring-jdbc/src/main/java/org/springframework/jdbc/object/RdbmsOperation.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -81,7 +81,7 @@ public abstract class RdbmsOperation implements InitializingBean {
8181
* least checking that a DataSource and sql have been provided,
8282
* but subclasses may also implement their own custom validation.
8383
*/
84-
private boolean compiled;
84+
private volatile boolean compiled;
8585

8686

8787
/**
@@ -349,7 +349,7 @@ public final void compile() throws InvalidDataAccessApiUsageException {
349349
* Is this operation "compiled"? Compilation, as in JDO,
350350
* means that the operation is fully configured, and ready to use.
351351
* The exact meaning of compilation will vary between subclasses.
352-
* @return whether this operation is compiled, and ready to use.
352+
* @return whether this operation is compiled and ready to use
353353
*/
354354
public boolean isCompiled() {
355355
return this.compiled;

0 commit comments

Comments
 (0)