Batch commands in DBException handling

More detailed batch commnad exception logging. Always attach batch
commands to the exception in case of DB exception.