close statment only if its not closed

This commit is contained in:
Hemant Kumar 2011-05-28 02:55:33 +05:30
parent 985ace4d7f
commit d48add714d

@ -102,7 +102,7 @@ def disconnect!
# Clears the prepared statements cache.
def clear_cache!
@statements.values.each { |hash| hash[:stmt].close }
@statements.values.each { |hash| !hash[:stmt].closed? && hash[:stmt].close }
@statements.clear
end