Pergunta

In my J2EE application I have the classe Reservation. To add a new Reservation I do:

public boolean addReservation(Reservation r) {
    try{
    reservationFacade.create(r);
    }catch(Exception e){return false;};
    return true;
}

This add immediately a new record in my db, but if I do a findAll() in my application, I can't see my new Reservation!!

I have this reservationFacadeLocal:

@Local
public interface ReservationFacadeLocal {

void create(Reservation r);

void edit(Reservation r);

void remove(Reservation r);

Reservation find(Object id);

List<Reservation> findAll();

List<Reservation> findRange(int[] range);

int count();

}
Foi útil?

Solução

I resolved the problem with em.refresh(entity);

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top