Session session = sessionManager.getSession();
Transaction transaction = null;
try {
transaction = session.beginTransaction();
SqlWorkspace sqlWorkspace = (SqlWorkspace) session.byId(SqlWorkspace.class).load(workspace.getWorkspaceId());
List<SqlWorkspaceUser> sqlWorkspaceUsers = sqlWorkspace.getSqlWorkspaceUserList();
boolean updateUser = false;
for (SqlWorkspaceUser sqlWorkspaceUser : sqlWorkspaceUsers) {
if (sqlWorkspaceUser.getUser().getUserId().equals(userId)) {
updateUser = true;