0
I wanted to upload the list to Thread and then have access to it after the action is over.
You have this code but at the end of the thread the list is null;
someone would have a tip to help me?
public class ThreadListarClientes {
private List<Cliente> clientes = null;
ClienteCTR clienteCTR = new ClienteCTR();
private Integer contaid = null;
public ThreadListarClientes carregarThreadListarClientes() throws InterruptedException {
Thread thread = new Thread() {
@Override
public void run() {
clientes = clienteCTR.listar(contaid, "clienteid", false);
}
};
thread.start();
while (thread.getState() != Thread.State.TERMINATED) {
Thread.sleep(100);
}
return this;
}
public List<Cliente> getClientes() {
return clientes;
}
public void setClientes(List<Cliente> clientes) {
this.clientes = clientes;
}
public Integer getContaid() {
return contaid;
}
public void setContaid(Integer contaid) {
this.contaid = contaid;
}
}
What language? Java?
– user28595
yes... but I actually think my problem is that Hibernate won’t accept being called inside Thead
– João Paulo