Declared JDBC operation compiled flag as volatile

Issue: SPR-13617
master
Juergen Hoeller 9 years ago
parent c1c07bbeb2
commit 81342f14d4
  1. 4
      spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/AbstractJdbcCall.java
  2. 6
      spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/AbstractJdbcInsert.java
  3. 6
      spring-jdbc/src/main/java/org/springframework/jdbc/object/RdbmsOperation.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;

@ -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;

@ -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;

Loading…
Cancel
Save