Overview of the Issue
When this issue happens, an db error message or a white page is shown.
Workaround
This issue is fixed. Updating to the latest version solves it on your site, so you only need this workaround if you can’t update yet.
There is no way to avoid this problem if you meet these conditions, until the issue itself gets fixed in WPML.
This will be fixed in WPML 3.1.8.4.