Skip to content

Commit

Permalink
Merge pull request #98 from lsst-sqre/tickets/DM-41951
Browse files Browse the repository at this point in the history
[DM-41951] setAutoCommit to false
  • Loading branch information
cbanek authored Dec 12, 2023
2 parents 8e11126 + 4b78a50 commit 0d87ff1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/main/java/org/opencadc/tap/impl/QServQueryRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ private void doIt()
// and restrict to forward only so that client memory usage is minimal since
// we are only interested in reading the ResultSet once

connection.setAutoCommit(false);
pstmt = connection.prepareStatement(sql);
pstmt.setFetchSize(1000);
pstmt.setFetchDirection(ResultSet.FETCH_FORWARD);
Expand Down
9 changes: 3 additions & 6 deletions src/main/java/org/opencadc/tap/impl/ResultStoreImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ public class ResultStoreImpl implements ResultStore {
public URL put(final ResultSet resultSet,
final TableWriter<ResultSet> resultSetTableWriter)
throws IOException {
OutputStream os;
os = getOutputStream();
OutputStream os = getOutputStream();
resultSetTableWriter.write(resultSet, os);
os.close();
return getURL();
Expand All @@ -113,8 +112,7 @@ public URL put(final ResultSet resultSet,
@Override
public URL put(Throwable throwable, TableWriter tableWriter)
throws IOException {
OutputStream os;
os = getOutputStream();
OutputStream os = getOutputStream();
tableWriter.write(throwable, os);
os.close();
return getURL();
Expand All @@ -124,8 +122,7 @@ public URL put(Throwable throwable, TableWriter tableWriter)
public URL put(final ResultSet resultSet,
final TableWriter<ResultSet> resultSetTableWriter,
final Integer integer) throws IOException {
OutputStream os;
os = getOutputStream();
OutputStream os = getOutputStream();

if (integer == null) {
resultSetTableWriter.write(resultSet, os);
Expand Down

0 comments on commit 0d87ff1

Please sign in to comment.