Hi all,

I'm currently having some trouble trying to read some CLOB's with
clojure.contrib.sql's with-query-results.  This happens even when I
force evaluation with a doall.

The code I have is this:

  (with-connection *application-db*
    (with-query-results rs ["SELECT myclob From MyTable"]
      (doall (map (fn [r]
                     (slurp* (. (:myclob r) getAsciiStream))) rs))))

Generating the following exception:

java.sql.SQLException: You cannot invoke other
java.sql.Clob/java.sql.Blob methods after calling the free() method or
after the Blob/Clob's transaction has been committed or rolled back.
  [Thrown class java.lang.RuntimeException]

Restarts:
 0: [ABORT] Return to SLIME's top level.
 1: [CAUSE] Throw cause of this exception

Backtrace:
  0: clojure.lang.LazySeq.sval(LazySeq.java:47)
  1: clojure.lang.LazySeq.seq(LazySeq.java:56)
  2: clojure.lang.Cons.next(Cons.java:37)
  3: clojure.lang.RT.next(RT.java:570)
  4: clojure.core$next__4229.invoke(core.clj:52)
  5: clojure.core$dorun__5245.invoke(core.clj:2084)
  6: clojure.core$doall__5250.invoke(core.clj:2097)
  7: myproject.record$read_db__5613$fn__5615$fn__5617.invoke(NO_SOURCE_FILE:1)
  8: 
clojure.contrib.sql.internal$with_query_results_STAR___7366.invoke(internal.clj:194)
  9: myproject.record$read_db__5613$fn__5615.invoke(NO_SOURCE_FILE:1)
 10: 
clojure.contrib.sql.internal$with_connection_STAR___7339.invoke(internal.clj:105)
 11: myproject.record$read_db__5613.invoke(NO_SOURCE_FILE:1)
 12: myproject.record$eval__5631.invoke(NO_SOURCE_FILE:1)
 13: clojure.lang.Compiler.eval(Compiler.java:4642)
 14: clojure.core$eval__5236.invoke(core.clj:2017)


Is this supported in clojure.contrib.sql, or do I need to make use of
Java/JDBC directly?

-- 
Rick Moynihan
http://twitter.com/RickMoynihan
http://delicious.com/InkyHarmonics
http://sourcesmouth.co.uk/

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to