@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -256,14 +256,14 @@ public class LazyConnectionDataSourceProxy extends DelegatingDataSource {
|
||||
@Nullable
|
||||
private String password;
|
||||
|
||||
private Boolean readOnly = Boolean.FALSE;
|
||||
|
||||
@Nullable
|
||||
private Boolean autoCommit;
|
||||
|
||||
@Nullable
|
||||
private Integer transactionIsolation;
|
||||
|
||||
private boolean readOnly = false;
|
||||
|
||||
private boolean closed = false;
|
||||
|
||||
@Nullable
|
||||
@@ -319,11 +319,15 @@ public class LazyConnectionDataSourceProxy extends DelegatingDataSource {
|
||||
if (method.getName().equals("toString")) {
|
||||
return "Lazy Connection proxy for target DataSource [" + getTargetDataSource() + "]";
|
||||
}
|
||||
else if (method.getName().equals("isReadOnly")) {
|
||||
return this.readOnly;
|
||||
else if (method.getName().equals("getAutoCommit")) {
|
||||
if (this.autoCommit != null) {
|
||||
return this.autoCommit;
|
||||
}
|
||||
// Else fetch actual Connection and check there,
|
||||
// because we didn't have a default specified.
|
||||
}
|
||||
else if (method.getName().equals("setReadOnly")) {
|
||||
this.readOnly = (Boolean) args[0];
|
||||
else if (method.getName().equals("setAutoCommit")) {
|
||||
this.autoCommit = (Boolean) args[0];
|
||||
return null;
|
||||
}
|
||||
else if (method.getName().equals("getTransactionIsolation")) {
|
||||
@@ -337,15 +341,11 @@ public class LazyConnectionDataSourceProxy extends DelegatingDataSource {
|
||||
this.transactionIsolation = (Integer) args[0];
|
||||
return null;
|
||||
}
|
||||
else if (method.getName().equals("getAutoCommit")) {
|
||||
if (this.autoCommit != null) {
|
||||
return this.autoCommit;
|
||||
}
|
||||
// Else fetch actual Connection and check there,
|
||||
// because we didn't have a default specified.
|
||||
else if (method.getName().equals("isReadOnly")) {
|
||||
return this.readOnly;
|
||||
}
|
||||
else if (method.getName().equals("setAutoCommit")) {
|
||||
this.autoCommit = (Boolean) args[0];
|
||||
else if (method.getName().equals("setReadOnly")) {
|
||||
this.readOnly = (Boolean) args[0];
|
||||
return null;
|
||||
}
|
||||
else if (method.getName().equals("commit")) {
|
||||
|
||||
Reference in New Issue
Block a user