[#4837] Add DefaultConnectionProvider.setReadOnly() and isReadOnly()
This commit is contained in:
parent
f8b2296dda
commit
9e121215d7
@ -183,6 +183,31 @@ public class DefaultConnectionProvider implements ConnectionProvider {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Convenience method to access {@link Connection#setReadOnly(boolean)}.
|
||||
*/
|
||||
public final void setReadOnly(boolean readOnly) throws DataAccessException {
|
||||
try {
|
||||
log.debug("setting read only", readOnly);
|
||||
connection.setReadOnly(readOnly);
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new DataAccessException("Cannot set readOnly", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Convenience method to access {@link Connection#isReadOnly()}.
|
||||
*/
|
||||
public final boolean isReadOnly() throws DataAccessException {
|
||||
try {
|
||||
return connection.isReadOnly();
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new DataAccessException("Cannot get readOnly", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Convenience method to access {@link Connection#setAutoCommit(boolean)}.
|
||||
*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user