Fix for issue ARQ-144

The proposed change fix the issue ARQ-144. I was unable to run all the integration tests, so I am not sure it it works for other databases but Oracle.