Skip to content
Closed
Changes from 1 commit
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
Prev Previous commit
CLOUDSTACK-8923: Close PreparedStatement when done.
  • Loading branch information
Boris Schrijver
Boris Schrijver committed Oct 5, 2015
commit 875cf770576dfe6e3760138f488839db1ce09eb5
4 changes: 3 additions & 1 deletion server/src/com/cloud/network/StorageNetworkManagerImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,13 @@ private void createStorageIpEntires(TransactionLegacy txn, long rangeId, String
stmt_insert.setLong(3, zoneId);
stmt_insert.setNull(4, java.sql.Types.DATE);
stmt_insert.executeUpdate();
stmt_insert.close();
}

try (PreparedStatement stmt_update = txn.prepareStatement(updateSql);) {
stmt_update.setLong(1, zoneId);
stmt_update.executeUpdate();
stmt_update.close();
}
}
}
Expand Down Expand Up @@ -223,7 +225,7 @@ public StorageNetworkIpRange createIpRange(final CreateStorageNetworkIpRangeCmd
checkOverlapPrivateIpRange(podId, startIp, endIp);
checkOverlapStorageIpRange(podId, startIp, endIp);

StorageNetworkIpRangeVO range = null;
//StorageNetworkIpRangeVO range = null;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please don't comment out code, remove it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know :) Still busy testing, please read the last comment of my PR message. I PR'd the first commit, then pushed the second one for testing.


final String endIpFinal = endIp;
return Transaction.execute(new TransactionCallbackWithException<StorageNetworkIpRangeVO, SQLException>() {
Expand Down