Insert to a database does not work with jar file.

2013-02-21 Thread Roland Pinto
So, i have function that looks something like this :
(defn insert-to-db [some-list]
 (map #(db/with-connection pool (db/insert-records :courses %)) some-list))

some-list here is just a list of hashmaps I want to insert and I'm calling 
this function from -main 
This works perfectly with lein repl and lein run. 

But if I run lein uberjar and do a java -jar target/file.jar it doesnt do 
anything at all.  I've doing other things like creating the db and printing 
out the rows from the db. They all work fine with the jar file. Also, 
inserting a single entry using insert-records works. It's really strange 
and I can't figure out what's happening

Thanks.



-- 
-- 
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.




Re: Insert to a database does not work with jar file.

2013-02-21 Thread Roland Pinto
I had a feeling this was due to laziness. Thanks for your help. It works 
now.

On Thursday, February 21, 2013 1:35:19 PM UTC-5, Michael Klishin wrote:


 2013/2/21 Roland Pinto roland...@gmail.com javascript:

 But if I run lein uberjar and do a java -jar target/file.jar it doesnt do 
 anything at all


 clojure.core/map is lazy. REPL forces evaluation because it needs to print 
 results
 to you.

 Wrap map in doall (if you need returned values) or dorun (if you only want 
 side effects).
 That will force evaluation.
 -- 
 MK

 http://github.com/michaelklishin
 http://twitter.com/michaelklishin
  

-- 
-- 
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.