Bug #1609: Fix problem using a different transaction in validation methods

In order to avoid to have the same user in the session twice, the validation
query of User entity has been done in a different transaction.

The issue happens with resources too, so the same solution has been used in
both cases.

FEA: ItEr77S04BugFixing