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 the
connection, which is resulting in a commit. Is there some way I can set
autocommit to false on the connection through the db-spec?
Unrelated to this, I had earlier been trying to use a DataSource provider
that we have and wrap it with {:datasource ds}, which worked fine for
executing queries, but db-set-rollback-only! would throw a
NullPointerException (from reset!) if I created the data source that way. I
dug around in the source code a bit more, but didn't see immediately what
was going on - that being said, I'm not terribly familiar with how atoms
work in Clojure.
Thanks for your help!
Mark
On Friday, October 25, 2013 2:10:18 AM UTC-4, Sean Corfield wrote:
>
> 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 <[email protected] <javascript:>>
> wrote:
> > 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
> > rolling back, as I'd hoped it would.
> >
> > You can see a simplified version of the script here:
> >
> > https://gist.github.com/anonymous/14ed57085709a2772ee0
> >
> > It's using an Oracle database (11GR1, I think) and clojure.java.jdbc
> version
> > 0.3.0-alpha5. I've dug through the clojure.java.jdbc docs and code, but
> I
> > don't see an obvious problem with what I'm doing, although I presume
> that to
> > someone who knows this library better, my problem is quite simple.
> >
> > Does anyone have any idea what I'm doing wrong? Can you point to an
> example
> > that issues deletes (or inserts, or updates) that rollback?
> >
> > Thanks!
> > Mark
> >
> > --
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Clojure" group.
> > To post to this group, send email to [email protected]<javascript:>
> > Note that posts from new members are moderated - please be patient with
> your
> > first post.
> > To unsubscribe from this group, send email to
> > [email protected] <javascript:>
> > 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 [email protected] <javascript:>.
> > 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 [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.