lib/spiderfw/model/storage/db/adapters/mysql.rb in spiderfw-0.6.28 vs lib/spiderfw/model/storage/db/adapters/mysql.rb in spiderfw-0.6.29
- old
+ new
@@ -90,15 +90,15 @@
end
def release
begin
#Spider::Logger.debug("MYSQL #{self.object_id} in thread #{Thread.current} releasing connection #{@conn}")
- @conn.autocommit(true) if @conn && !Spider.conf.get('storage.db.shared_connection')
+ curr[:conn].autocommit(true) if curr[:conn] && !Spider.conf.get('storage.db.shared_connection')
super
rescue => exc
- Spider::Logger.error("MYSQL #{self.object_id} in thread #{Thread.current} exception #{exc.message} while trying to release connection #{@conn}")
- self.class.remove_connection(@conn, @connection_params)
- @conn = nil
+ Spider::Logger.error("MYSQL #{self.object_id} in thread #{Thread.current} exception #{exc.message} while trying to release connection #{curr[:conn]}")
+ self.class.remove_connection(curr[:conn], @connection_params)
+ curr[:conn] = nil
end
end
def self.connection_alive?(conn)
begin