SONAR-5394 open SQL write connection only on first statement