[phylr] r51 commited - check for null before close a resultset

1 view
Skip to first unread message

codesite...@google.com

unread,
Jul 29, 2009, 5:22:40 PM7/29/09
to phylr-...@googlegroups.com
Revision: 51
Author: dazhi.jiao
Date: Wed Jul 29 13:27:43 2009
Log: check for null before close a resultset
http://code.google.com/p/phylr/source/detail?r=51

Modified:

/trunk/phylr-gsoc/src/main/java/org/nescent/phylr/relational/RelationalQueryResult.java

/trunk/phylr-gsoc/src/main/java/org/nescent/phylr/relational/RelationalRecordIterator.java

=======================================
---
/trunk/phylr-gsoc/src/main/java/org/nescent/phylr/relational/RelationalQueryResult.java
Wed Jul 29 07:01:00 2009
+++
/trunk/phylr-gsoc/src/main/java/org/nescent/phylr/relational/RelationalQueryResult.java
Wed Jul 29 13:27:43 2009
@@ -32,8 +32,10 @@
super.close();
log.info("RelationalResultSet close");
try {
- if (!this.hits.isClosed()) {
- this.hits.close();
+ if (this.hits != null) {
+ if (!this.hits.isClosed()) {
+ this.hits.close();
+ }
}
} catch (SQLException e) {
// TODO Auto-generated catch block
=======================================
---
/trunk/phylr-gsoc/src/main/java/org/nescent/phylr/relational/RelationalRecordIterator.java
Wed Jul 29 07:01:00 2009
+++
/trunk/phylr-gsoc/src/main/java/org/nescent/phylr/relational/RelationalRecordIterator.java
Wed Jul 29 13:27:43 2009
@@ -69,8 +69,10 @@

public void close() {
try {
- if (!this.result.hits.isClosed())
- this.result.hits.close();
+ if (this.result.hits != null) {
+ if (!this.result.hits.isClosed())
+ this.result.hits.close();
+ }
} catch (Exception ex) {
log.error("Failed to close ResultSet object: " + ex.getMessage());
}

Reply all
Reply to author
Forward
0 new messages