This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(import [java.util.concurrent Executors]) | |
(defn test-stm [nitems nthreads niters] | |
(let [refs (map ref (replicate nitems 0)) | |
pool (. Executors (newFixedThreadPool nthreads)) | |
tasks (map (fn [t] | |
(fn [] | |
(dotimes [n niters] | |
(sync nil | |
(doseq [r refs] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try: | |
cur.execute('select * from blah') | |
except cx_Oracle.DatabaseError as e: | |
error, = e.args | |
print(error.code) | |
print(error.message) | |
print(error.context) | |
import pdb ; pdb.set_trace() |