Skip to content

Commit 81342f1

Browse files
committed
Declared JDBC operation compiled flag as volatile
Issue: SPR-13617
1 parent c1c07bb commit 81342f1

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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;
@@ -329,7 +329,7 @@ protected void onCompileInternal() {
329329

330330
/**
331331
* Is this operation "compiled"?
332-
* @return whether this operation is compiled, and ready to use.
332+
* @return whether this operation is compiled and ready to use
333333
*/
334334
public boolean isCompiled() {
335335
return this.compiled;

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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 3 additions & 3 deletions
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
/**
@@ -350,7 +350,7 @@ public final void compile() throws InvalidDataAccessApiUsageException {
350350
* Is this operation "compiled"? Compilation, as in JDO,
351351
* means that the operation is fully configured, and ready to use.
352352
* The exact meaning of compilation will vary between subclasses.
353-
* @return whether this operation is compiled, and ready to use.
353+
* @return whether this operation is compiled and ready to use
354354
*/
355355
public boolean isCompiled() {
356356
return this.compiled;

0 commit comments

Comments
 (0)