Re: Rolling back transactions with clojure.java.jdbc

2013-10-25 Thread Mark Tomko
Looks like that was a success. Thanks for the help! On Fri, Oct 25, 2013 at 11:26 AM, Mark Tomko wrote: > Thanks Sean. I'll give it a try! > > > > > On Fri, Oct 25, 2013 at 11:21 AM, Sean Corfield wrote: > >> Second bug in your code: (delete-scores-for-column db cid) >> >> Should be: (delete-sc

Re: Rolling back transactions with clojure.java.jdbc

2013-10-25 Thread Mark Tomko
Thanks Sean. I'll give it a try! On Fri, Oct 25, 2013 at 11:21 AM, Sean Corfield wrote: > Second bug in your code: (delete-scores-for-column db cid) > > Should be: (delete-scores-for-column t cid) > > Sorry I didn't see that (additional) bug first time around when I > suggested removing :trans

Re: Rolling back transactions with clojure.java.jdbc

2013-10-25 Thread Sean Corfield
Second bug in your code: (delete-scores-for-column db cid) Should be: (delete-scores-for-column t cid) Sorry I didn't see that (additional) bug first time around when I suggested removing :transaction? from delete! execute! does not call with-open if it can find an active connection in the passe

Re: Rolling back transactions with clojure.java.jdbc

2013-10-25 Thread Mark
Scratch that aside, I think I have that part working. It was a little gnarly because the datasource provider was written in Scala and posed a few potentially confusing interop problems, and I must have gotten it wrong on at least one account. However, I'm still seeming to commit automatically.

Re: Rolling back transactions with clojure.java.jdbc

2013-10-25 Thread Mark
That doesn't seem to work. Neither does explicitly setting :transaction? to false. Looking at the source of execute!, it looks like the statement is running within a "with-open" on the java.sql.Connection, which is where a commit or rollback would occur. I presume that the with-open is closing

Re: Rolling back transactions with clojure.java.jdbc

2013-10-24 Thread Sean Corfield
Remove :transaction? true from the delete! call. You're telling delete! to run inside its own transaction - you don't want that: that's why your deletes do not rollback. Sean On Thu, Oct 24, 2013 at 2:03 PM, Mark wrote: > I've been working on a small utility script to clean up a very large tabl

Rolling back transactions with clojure.java.jdbc

2013-10-24 Thread Mark
I've been working on a small utility script to clean up a very large table (~1 billion rows). Because the table is so large, I want to go through and delete it chunk at a time. I've written a simple script that does this, but when I was testing it against our dev instance, I found that it wasn't