What does your code look like that queries MySQL? The above code
writes to MongoDB which is not going to throw SQLException anyway.

On Fri, Apr 26, 2013 at 8:01 AM, larry google groups
<lawrencecloj...@gmail.com> wrote:
>
> I wrote a simple app that gets my data out of an old mysql database and puts
> it into mongodb. I have this function:
>
> (defn add-this-record-to-mongo [db record item-type]
>   (println (str (:user db)))
>   (println (str item-type))
>   (try
>     (let [record (assoc record :item-type item-type)
>           record (assoc record :community (:user db))
>           item-name (str (:community record) "-" (:item-type record) "-"
> (:id record))
>           record (assoc record :item-name item-name)]
>       (mongo/persist-document-to-database record))
>     (catch java.sql.SQLException e (println (apply str e)))))
>
> Right now, when I run this app, it grabs the first 147,879 records and then
> dies with this exception:
>
> java.lang.RuntimeException: java.sql.SQLException: Cannot convert value
> '0000-00-00 00:00:00' from column 6 to TIMESTAMP.
>
> I thought I had written the try/catch blog so that this exception would be
> logged, but otherwise ignored.
>
> Instead, this exception stops my app cold -- the app stops.
>
> How do I get the app to ignore these exceptions?
>
> --
> --
> 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
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to