In addition to his work as an artist, Ben maintains bitsynthesis.com and is a contributing writer for vagueterrain.net
Clojure Database Transactions with JDBC
code, code p { background:white; }
I’ve been experimenting with the Clojure programming language, and it’s been a lot of fun. But being rather new to the language, it took me a bit of trial and error to figure out how to implement transactions for an SQL database using the clojure.java.jdbc database connector library. Here’s what I found.
First, let’s look at a standard database call without transactions.
(ns vidbmk.model
(:require [clojure.java.jdbc :as jdbc]))
(def db-spec {:subprotocol "postgresql"
:subname "//localhost:5432/testdb"
:user "test"
:password "test"})
(jdbc/insert! db-spec :mytable {:id 1, :name "test data"})
- The first line is the namespace declaration, which also pulls in the clojure.java.jdbc library, to be referenced by “jdbc” prefix.
- Then we define db-spec as a map of the database connection details.
- Finally, we run the command to insert a row of test data into a table called “mytable”. Note that we pass in the db-spec map as the first argument for jdbc/insert!.
That’s fine, but we would really like to be able to roll back that insert call in the case of an exception, or for testing purposes. To do this, you just need to wrap all your database calls in db-transaction, like so (the namespace and db-spec remain the same).
(jdbc/db-transaction [t-con db-spec]
(jdbc/insert! t-con :mytable {:id 1, :name "test data"}))
Notice that the addition of t-con, and its replacement of db-spec in the call to insert!. t-con can be any arbitrary name you want, it is bound to the database connection created by db-transaction, and whatever you choose for a name will replace db-spec in all database calls nested within the db-transaction.
For example, to apply a transaction bound to “blahblah” to multiple database calls…
(jdbc/db-transaction [blahblah db-spec]
(jdbc/insert! blahblah :mytable {:id 1, :name "test data"})
(jdbc/insert! blahblah :mytable {:id 2, :name "more test data"}))
If anything within the db-transaction scope throws an exception, the transaction will be rolled back. Or, you can force a rollback by explicitly calling db-set-rollback-only! within the transaction scope.
(jdbc/db-transaction [blahblah db-spec]
(jdbc/insert! blahblah :mytable {:id 1, :name "test data"})
(jdbc/insert! blahblah :mytable {:id 2, :name "more test data"})
(jdbc/db-set-rollback-only! blahblah))
More examples here: https://github.com/clojure/java.jdbc/blob/master/doc/clojure/java/jdbc/UsingSQL.md
GLi.TC/H 2112 :: DEC 6-9 CHICAGO

GLI.TC/H 2112, the 3rd annual dirty new media gathering, is happening this week in Chicago!
I will be participating in the night of realtime performances happening Friday, December 7, at Tritriangle (1550 N Milwaukee, 3rd floor, 1/2 block from Damen Blue Line), both individually for Jason Soliday’s NO_MEDIA
NO_MEDIA is a performance framework that goes from zero to zero! Participating performers will start from blank slates, build sets from scratch. No preparation allowed. Zeroed out knobs. No strings on your guitar. No presets. Everything done in realtime from beginning to end. Everything that happens exists only in and during the performance :: “Raw Real Time”. After ~10 minutes you will delete all assets. It happens…. and … then it’s gone…
and with Evan Kühl as Vaudeo Signal for the Open Robin.
The format is inspired by the [Dirty] New-Media Round Robin curated by Nick Briz on OCT 16, 2012; inspired by the Baltimore music scene, where performers set-up at the same time around the perimeter of the venue and perform short sets one after another (around the circle) passing the baton (or cables in this case) from one to the next. The Open Robin breaks the circle to allow for new connexxxions && collaborations.
There are also LOADS of other exciting workshops, panels, collaborative environments, and gatherings. Dive into the schedule or go straight to GLI.TC/H to see what’s up.
video by Bob Weisz
Chicago Dirty New Media: Round Robin ((MCA))
This Tuesday, October 16, a veritable tribe of Dirty Media hooligans will descend on the parking garage at the Chicago Museum of Contemporary Art. The show starts promptly at 6 p.m.
Set-up begins at 4 p.m. and is open to the public, so if you want to check out the varied performance rigs, come early.
In the garage…

Join us for this real-time audio and video performance event which celebrates the Dirty New Media movement in Chicago. Dirty New Media artists utilize hacked electronics and improvisation to create works of art that are so wrong they’re right.
Performances take place in the bottom level of the museum’s garage (accessible by Chicago Avenue, at the intersection of N. Fairbanks Ct.) and start at 6 pm, with setup starting at 4 pm. Feel free to stop in and chat with folks as they prep their circuits and setup. This event is organized in collaboration with Nick Briz, an artist currently based in Chicago.
_∆∆øÑσ.-~máh⌡!îx
Arcanebolt
Felker, Lori
Jason Soliday
jon.satrom
Lisa Slodki
Monica Panzarino
Morgan Higby-Flowers
Square Square
Vaudeo Signal
William Robertson
Zarzutzki
Piksel[X] Call for Projects

Norway’s annual open source art festival, taking place in Bergen this fall, has released an official call for projects. I participated in Piksel last year, and it was a fantastic experience. There were tons of interesting folks and technological artworks from around the world, all coming together in the spirit of DIY.
Visit the information page below for the submission form and more details. The deadline is August 15.
http://piksel.no/ocs/index.php/piksel/piksel12/schedConf/cfp
GlitchBot and the Thirty Days Project
For the month of June, GlitchBot will be participating in the Thirty Days Project. See GlitchBot’s daily submissions here.
Thirty Days Project is thirty deadlines; finish a piece of creative work by the end of each day.

Ende Tymes Screening – Brooklyn – May 17
Modulating Fashions in Fades and Wipes and SNObound, the two most recent video works from Evan Kühl and myself, are being screened tomorrow night as part of Ende Tymes at Outpost in Brooklyn, NYC.
This will be the world premier of Modulating Fashions in Fades and Wipes, and the New York premier of SNObound. Evan will be there in person, so come check out the show!

Bus Tops – animations on London bus shelters
Some English chaps got together and built 30 awesome red LED panels, and installed them on the roofs of bus shelters in 20 London boroughs. The project, Bus-Tops will be showing animated and still artworks for the next 8 months or so, primarily targeting people sitting on the top level of double decker buses. See the BBC report below, and this video documentation for a clearer view of a panel in action.
The last half of February has been “glitch” themed, curated by DoDD, moderator of the Glitch Art group on Flickr. During this time a selection of my works has be screened alongside the creations of Glitch-Irion, Stallio, Pixel Noizz, Notendo, Hellocatfood, and Gridworks1.
EDIT: Here’s a video of the Glitch works in action:
Below are my submissions. Under each GIF is the video recording it was sourced from, sculpted using a combination of old analog video hardware and custom-built signal generators. Londoners, check the project page for scheduling times / locations.
If anyone has video footage of my designs in action, please please please send me a copy!
SNO 005B

SNO 12B

SNO 001A

SNO 009B

GLI.TC/H 2011 Recap
The second annual GLI.TC/H noise & dirty new media gathering was held this past November. As part of the festivities, Evan Kühl and myself performed Vaudeo Signal at Enemy (Chicago) and at Steim (Amsterdam). Unsound, a selection from the Vaudeo Signal DVD, was also screened in Birmingham.
Thanks go out to all the organizers who put together such an exciting program of works, and for getting them presented in 3 cities, in 3 countries, in 3 weeks!
Vaudeo Signal @ Enemy, Chicago – 11.05.11
There’s a nice summation of the previous night of performances in Chicago on the fnewsmagazine website.
Vaudeo Signal @ Steim, Amsterdam – 11.12.11

A video overview of the multi-faceted Amsterdam GLI.TC/H show is available here.
Bonus: “found glitch” on the plane to Amsterdam
Thanks to Jackie for recording our Chicago performance, and to the gif-makers who created the Amsterdam gifs… if any of these images are yours please let me know and I’ll credit you!
For more videos, downloads, and show information, please visit vaudeosignal.com.
LGRU Networked Graphics Demoparty
Hosted by WORM in Rotterdam, Netherlands and online at lgru.hotglue.me.

