This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-12-28
Channels
- # adventofcode (6)
- # beginners (61)
- # boot (1)
- # chestnut (1)
- # cider (18)
- # cljs-dev (1)
- # cljsrn (3)
- # clojure (176)
- # clojure-android (8)
- # clojure-germany (12)
- # clojure-russia (4)
- # clojure-spec (7)
- # clojure-uk (5)
- # clojurescript (28)
- # css (10)
- # cursive (36)
- # datomic (7)
- # devcards (1)
- # docs (8)
- # emacs (17)
- # fulcro (29)
- # hoplon (28)
- # lein-figwheel (3)
- # leiningen (37)
- # lumo (1)
- # off-topic (54)
- # om (6)
- # re-frame (2)
- # reitit (7)
- # ring-swagger (23)
- # shadow-cljs (115)
- # sql (10)
- # uncomplicate (1)
- # unrepl (24)
Im trying to use @seancorfield’s config but Im getting a missing parameter error (it doesnt says which one though)
CompilerException java.lang.IllegalArgumentException: db-spec com.mchange.v2.c3p0.ComboPooledDataSource[ identityToken -> 1hge13j9s17njdkd8lln19|49c17ba4, dataSourceName -> scheduler-ds ] is missing a required parameter, compiling: ...
here is the code im trying to use:
(def db-spec (doto (ComboPooledDataSource.)
(.setDataSourceName "scheduler-ds")
(.setDriverClass "com.mysql.jdbc.Driver")
(.setJdbcUrl (str "jdbc:mysql://"
(:db-host cfg)
":" (:db-port cfg)
"/" (:db-name cfg)
"?zeroDateTimeBehavior=convertToNull"))
(.setUser (:db-user cfg))
(.setPassword (:db-password cfg))
;; pool size (default is 3 and 15):
(.setMinPoolSize 3)
(.setMaxPoolSize 15)
(.setNumHelperThreads 3)
;; initial pool size default is 3 but actual pool size
;; must be between minimum and maximum pool size
(.setInitialPoolSize 3)
;; expire excess connections after 10 mins of inactivity:
(.setMaxIdleTimeExcessConnections (* 10 60))
;; expire connections after 61 minutes of inactivity:
(.setMaxIdleTime (* 61 60))
;; idle connection testing
;(.setAutomaticTestTable "c3p0connection")
(.setTestConnectionOnCheckin true)
(.setIdleConnectionTestPeriod (* 11 60))
;; unreturned (app leakage) get zapped after an hour:
(.setUnreturnedConnectionTimeout (* 59 60))))
this previous config was kinda working
(def old-db-spec (pool/make-datasource-spec
{:subprotocol "mysql"
:user (:db-user cfg)
:password (:db-password cfg)
:subname (str "//" (:db-host cfg)
":" (:db-port cfg)
"/" (:db-name cfg)
"?zeroDateTimeBehavior=convertToNull")}))
Your db-spec
should be a hash map.
{:datasource (doto ...)}
@seancorfield not sure why, but the problem went away using your configuration, thank you very much!!!
Excellent! Probably the array of timeouts.
Strangely, we're testing a new MySQL setup and one query is giving us a communications link failure consistently (all the other queries we've run seem to work as expected). But I don't think it's our code 🙂 I think there's an issue with the ProxySQL setup so I'm working with our DBAs on that.