0

It's my first time trying this, but I'm getting the following error:

The result set is closed

while trying to use ScrollableResults.

@Override
public void associarTodosConteudos(LoteTransferenciaTO lotetransferencia, UsuarioDepartamentoTO udLogado, Long idDepartamento, Long idUsuario) {
    // Lista os objetos controlados fluxo
    ScrollableResults objetos = this.persistencia.listarConteudosSR(idDepartamento, idUsuario);

    while (objetos.next()) {
        ContentTO content = (ContentTO) objetos.get(0);

        this.negocioVinculoLote.adicionarNoLoteTransferencia(lotetransferencia, content, udLogado);
    }
}
Qiu
  • 5,651
  • 10
  • 49
  • 56
Johnny Santana
  • 157
  • 1
  • 3
  • 15

1 Answers1

1

ScrollableResults is closed once this method this.persistencia.listarConteudosSR(idDepartamento, idUsuario); is exited.

Try to iterate over the ScrollableResults inside this.persistencia.listarConteudosSR(idDepartamento, idUsuario); method. it should work.

for more details refer https://docs.jboss.org/hibernate/orm/3.3/reference/en/html/batch.html

riccardo.cardin
  • 7,971
  • 5
  • 57
  • 106
user3435860
  • 59
  • 1
  • 5