You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ja...@apache.org on 2014/01/23 14:00:56 UTC
[3/3] git commit: updated refs/heads/master to c53778c
CLOUDSTACK-5810 updated null checks and preparestmt and resultset close
Closing the prepare statement and result set and assigning null to the object after close.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c53778c3
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c53778c3
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c53778c3
Branch: refs/heads/master
Commit: c53778c33306f4a87387b932d9d9a9cb6069bdd5
Parents: 4925b9f6a
Author: Jayapal <ja...@apache.org>
Authored: Thu Jan 23 18:13:45 2014 +0530
Committer: Jayapal <ja...@apache.org>
Committed: Thu Jan 23 18:27:03 2014 +0530
----------------------------------------------------------------------
.../com/cloud/upgrade/dao/Upgrade430to440.java | 64 +++++++-------------
1 file changed, 21 insertions(+), 43 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c53778c3/engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java
index 052c56c..3b967e7 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java
@@ -126,43 +126,17 @@ public class Upgrade430to440 implements DbUpgrade {
}
}
-
-
- if (networkRs != null) {
- try {
- networkRs.close();
- } catch (SQLException e) {
- }
- }
-
-
- if (pstmtNw != null) {
- try {
- pstmtNw.close();
-
- } catch (SQLException e) {
- }
- }
-
- }
- } //if
-
-
- if (vmRs != null) {
- try {
- vmRs.close();
- } catch (SQLException e) {
- }
- }
-
- if (networkRs != null) {
- try {
networkRs.close();
- } catch (SQLException e) {
+ networkRs = null;
+ pstmtNw.close();
+ pstmtNw = null;
}
- }
-
+ } //if
+ pstmtVm.close();
+ pstmtVm = null;
+ vmRs.close();
+ vmRs = null;
} // while
@@ -179,36 +153,40 @@ public class Upgrade430to440 implements DbUpgrade {
}
- if (pstmtVm != null) {
+ if (rs1 != null) {
try {
- pstmtVm.close();
+ rs1.close();
} catch (SQLException e) {
}
}
- if (pstmtNw != null) {
- try {
- pstmtNw.close();
+ if (pstmtVm != null) {
+ try {
+ pstmtVm.close();
} catch (SQLException e) {
}
}
- if (rs1 != null) {
+ if (vmRs != null) {
try {
- rs1.close();
+ vmRs.close();
} catch (SQLException e) {
}
}
- if (vmRs != null) {
+
+
+ if (pstmtNw != null) {
try {
- vmRs.close();
+ pstmtNw.close();
+
} catch (SQLException e) {
}
}
+
if (networkRs != null) {
try {
networkRs.close();