Bug #4393 : unexpected error on creation of domains because of using directly domain names to perform technical operations on the database or the file system

- modifying the treatment that computing technical domain database name to obtain an unique name
- refactoring some code
- modifying some error messages