added synchronization to compile method (SPR-6001)

master
Thomas Risberg 15 years ago
parent ae461db82a
commit ceca0db645
  1. 2
      org.springframework.jdbc/src/main/java/org/springframework/jdbc/core/simple/AbstractJdbcCall.java
  2. 2
      org.springframework.jdbc/src/main/java/org/springframework/jdbc/core/simple/AbstractJdbcInsert.java

@ -249,7 +249,7 @@ public abstract class AbstractJdbcCall {
* @throws org.springframework.dao.InvalidDataAccessApiUsageException if the object hasn't
* been correctly initialized, for example if no DataSource has been provided
*/
public final void compile() throws InvalidDataAccessApiUsageException {
public synchronized final void compile() throws InvalidDataAccessApiUsageException {
if (!isCompiled()) {
if (getProcedureName() == null) {
throw new InvalidDataAccessApiUsageException("Procedure or Function name is required");

@ -239,7 +239,7 @@ public abstract class AbstractJdbcInsert {
* @throws org.springframework.dao.InvalidDataAccessApiUsageException if the object hasn't
* been correctly initialized, for example if no DataSource has been provided
*/
public final void compile() throws InvalidDataAccessApiUsageException {
public synchronized final void compile() throws InvalidDataAccessApiUsageException {
if (!isCompiled()) {
if (getTableName() == null) {
throw new InvalidDataAccessApiUsageException("Table name is required");

Loading…
Cancel
Save