 	openTransaction,
 	(request, response, next) ->
 		nameIsValid = lib.validation.characterNameIsValid(request.body.character_name)
-		alreadyExists = lib.character.characterExists.sync(null, request.uonline.tx, request.body.character_name)
+		alreadyExists = lib.character.characterExists.sync(null, request.uonline.db, request.body.character_name)
 
 		if nameIsValid and not alreadyExists
 			charid = lib.character.createCharacter.sync(
 				null
-				request.uonline.tx
+				request.uonline.db
 				request.uonline.user.id
 				request.body.character_name
 				request.body.character_race

	openTransaction,
	(request, response, next) ->
		lib.game.hitOpponent.sync(
			null, request.uonline.tx,
			request.uonline.user.character_id,
			request.body.id,
			request.body.with_item_id

	throw new Error 'Emulated error.'

app.get '/explode_db/', openTransaction, (request, response) ->
	request.uonline.db.query.sync request.uonline.db, 'SELECT * FROM "Emulated DB error."'
, commit


