As a bonus my init database code now runs twice as fast. Yah!
def do_in_transaction(func, *args, **kw):
old_conn = sqlhub.getConnection()
conn = old_conn.transaction()
sqlhub.threadConnection = conn
value = func(*args, **kw)
sqlhub.threadConnection = old_conn
# I needed to change my connection line to this. That is assign something
# to the processConnection thing in sqlhub.
# sqlhub.processConnection = db_connection = __connection__ = connectionForURI(config.conn)