Permalink
Browse files

Empirical timing tests indicate the binding is unnecessary

  • Loading branch information...
Paul Legato
Paul Legato committed May 26, 2012
1 parent 6d30513 commit 6d9fb0f9f409497260684f5063838655c5849968
Showing with 9 additions and 10 deletions.
  1. +9 −10 src/korma/db.clj
View
@@ -192,16 +192,15 @@
(get-connection db))
(jdbc/find-connection)
(get-connection @_default))))]
- (binding [ijdbc/*db* {:connection conn}] ;; not sure if this binding is necessary, since we're preparing our own statement, but maybe with-query-results* uses *db*
- (let [initial-autocommit (.getAutoCommit conn)]
- (try
- (.setAutoCommit conn false)
- (let [statement (jdbc/prepare-statement conn
- sql
- :fetch-size chunksize)]
- (ijdbc/with-query-results* [statement params] func))
- (catch Exception e (handle-exception e sql params))
- (finally (.setAutoCommit conn initial-autocommit))))))))
+ (let [initial-autocommit (.getAutoCommit conn)]
+ (try
+ (.setAutoCommit conn false)
+ (let [statement (jdbc/prepare-statement conn
+ sql
+ :fetch-size chunksize)]
+ (ijdbc/with-query-results* [statement params] func))
+ (catch Exception e (handle-exception e sql params))
+ (finally (.setAutoCommit conn initial-autocommit)))))))
(defmacro with-lazy-results
"Executes the given query with the JDBC driver set to return results

0 comments on commit 6d9fb0f

Please sign in to comment.