{
// already exists check should be done in the same transaction
// but we assume we don't have a huge load and a lot of concurrent access ;-)
if ( alreadyExistsProfileName( profile ) )
{
throw new AlreadyExistsProfileException( "profile with name " + profile.getName() + " already exists" );
}
profile.setBuilder( null );
profile.setJdk( null );
profile.setEnvironmentVariables( null );
return profileDao.addProfile( profile );