Erro com ExecutorService com newFixedThreadPool();

0 respostas
java
JJjava

Tenho em

ExecutorService executor = Executors
                      .newFixedThreadPool(Sistema.getNumberProcessors());

Que no caso a má tem 8 núcleos.

try {
            for (int k = 0; k < Sistema.getNumberProcessors(); k++) {   
                executor.execute(new CargaMapeaEntidadesThread(ini, fim, "Thread"+k));
                ini = fim;
                fim = fim + lote;
            }
            executor.shutdown();
            while (!executor.isTerminated()) {
            }
            System.out.println("Acabou !!!!!!!!");
        } catch (Exception e) {
            System.err.println(e);
        }

8 Threads iniciam e apenas 5 terminam, porem ocorre exceptions no processo.
Minha pergunta é: Uma exception q nao é uma InterruptedException interrompe uma thread?

as Exceptions q sairam no processo foram:
Exception: java.sql.DataTruncation: Data truncation
java.lang.NullPointerException

Criado 24 de fevereiro de 2017
Respostas 0
Participantes 1