I have
@Table(name = "SGM_GRUPO") @Entity @Proxy(proxyClass = GrupoTO.class) public class GrupoTO{
@ManyToMany(targetEntity = UsuarioTO.class,fetch = FetchType.LAZY) @JoinTable(name = "SGM_GRUPO_USUARIO",joinColumns = @JoinColumn(name = "id_grupo"),inverseJoinColumns = @JoinColumn(name = "id_usuario")) @OrderBy(value = "nome") private Set <UsuarioTO> usuarios;
}
When there are many 'usuarios' bound to that entity to make a 'merge': (session.merge(bean)) takes too long time.
Is there any way to optimize?
this takes 96 seconds: try { Session session = getCurrentSession(); session.merge(bean); session.flush(); return bean; } catch (Throwable e) { throw Util.getBaseException(e); }
|