Welcome and thanks

4 views
Skip to first unread message

John D. Hume

unread,
Aug 18, 2009, 5:27:39 PM8/18/09
to clj-rec...@googlegroups.com
Welcome to the clj-record-dev discussion group. Thanks for using
clj-record and for contributing. (Everyone currently signed up for the
group has contributed code.)

I'm going to start throwing some questions out there to give me a
better idea of how people are using clj-record and help me prioritize
a number of things that I'd like to improve, the first of those being
...

Testing with databases other than Derby
It's very convenient that the Derby jar can be bundled along with the
source to make tests extremely portable, but Derby is also fairly
feature-limited. I'd hate to hold back on new features that popular
DBMS's support just because they can't be tested with Derby.

So what database(s) are you using with clj-record? What tweaks did you
have to make to get it working?

Thanks.
-hume.

--
http://elhumidor.blogspot.com/

Daniel Renfer

unread,
Aug 18, 2009, 5:31:33 PM8/18/09
to clj-rec...@googlegroups.com
I ran into this problem in particular when I was trying to hack in
support for LIMIT.

I use MySql, so full support for Derby isn't as high of a priority for me.

Mark Derricutt

unread,
Aug 18, 2009, 5:35:04 PM8/18/09
to clj-rec...@googlegroups.com
Hey John,

Loving clj-record, currently using it with postgresql deployed to mor.ph.  Due to the way mor.ph works (and well, most app servers really) I get a JNDI reference to a datasource to use, support for using JNDI was one of the first tweaks I added to clj-record when I first started using it (ultimately this change turned up in clojure-contrib thou).

However, to support my testing without changing the code, I added myself a simple JNDI "server":

(ns com.jobsheet.initial-context-factory
  (:gen-class :implements [javax.naming.spi.InitialContextFactory]))

(def bindings (ref {}))

(def context
  (proxy [javax.naming.InitialContext] [true]
    (bind [name object] (dosync (alter bindings assoc name object)))
    (unbind [name] (dosync (alter bindings dissoc name)))
    (lookup [name] (get @bindings name))))

(defn -getInitialContext [this environment] context)
(defn bind [name value] (.bind context name value))


which I use in conjunction with commons-dbcp:

(System/setProperty Context/INITIAL_CONTEXT_FACTORY "com.jobsheet.initial_context_factory");

(jndi/bind "java:/comp/env/jdbc/morph-ds" (doto (org.apache.commons.dbcp.BasicDataSource.)
   (.setDriverClassName "org.postgresql.Driver")
   (.setUsername "x")
   (.setPassword "x")
   (.setUrl "jdbc:postgresql:jobsheet")))



--
Reply all
Reply to author
Forward
0 new messages