Skip to content

Revert "Remove unnecessary throws clause" #430

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/java/org/mybatis/spring/SqlSessionTemplate.java
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ public List<BatchResult> flushStatements() {

/**
* Allow gently dispose bean:
*
*
* <pre>
* {@code
*
Expand All @@ -407,7 +407,7 @@ public List<BatchResult> flushStatements() {
* @see "org.springframework.beans.factory.support.DisposableBeanAdapter#CLOSE_METHOD_NAME"
*/
@Override
public void destroy() {
public void destroy() throws Exception {
// This method forces spring disposer to avoid call of SqlSessionTemplate.close() which gives
// UnsupportedOperationException
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public MyBatisCursorItemReader() {
}

@Override
protected T doRead() {
protected T doRead() throws Exception {
T next = null;
if (cursorIterator.hasNext()) {
next = cursorIterator.next();
Expand All @@ -59,7 +59,7 @@ protected T doRead() {
}

@Override
protected void doOpen() {
protected void doOpen() throws Exception {
Map<String, Object> parameters = new HashMap<>();
if (parameterValues != null) {
parameters.putAll(parameterValues);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,15 @@ public void rollback() throws SQLException {
* {@inheritDoc}
*/
@Override
public void close() {
public void close() throws SQLException {
DataSourceUtils.releaseConnection(this.connection, this.dataSource);
}

/**
* {@inheritDoc}
*/
@Override
public Integer getTimeout() {
public Integer getTimeout() throws SQLException {
ConnectionHolder holder = (ConnectionHolder) TransactionSynchronizationManager.getResource(dataSource);
if (holder != null && holder.hasTimeout()) {
return holder.getTimeToLiveInSeconds();
Expand Down