Catch sqlexception during transactions and unravel with getNextException

Signed-off-by: Ken Barber <ken@bob.sh>
Add tests for concurrency

Signed-off-by: Ken Barber <ken@bob.sh>