Cant see my new data after ejb 3.0 Facade.create()
I am adding an address using EJB 3.0 Facade.create() method. On a separate page I call another EJB 3.0 customer.getAddressCollection() method, but the collection of addresses still has the old list. It does not have the new address in there.If I log out and back in it still does not show the new address. Only when I start another session can I see the new address.
I am using Sun App Server version 9.0.
Is there some App Server setting or some "flush" or "commit" method I am overlooking?
Here is the relevant code:
// update the database using the Facade EJB
addressFacade.create(address);
customerMaintenanceMessage ="finished adding address";
request.setAttribute("activity","mainPage");
request.setAttribute("customerMaintenanceMessage",customerMaintenanceMessage);
RequestDispatcher disp = getServletContext().getRequestDispatcher("/CustomerMaintenance");
disp.forward(request, response);
//forward to the addressList page:
Customer thisCustomer = customerFacade.find(customerId);
List<Address> addresses = (List)thisCustomer.getAddressCollection();
request.setAttribute("addresses",addresses);
disp = getServletContext().getRequestDispatcher("/AddressList.jsp");
disp.forward(request, response);
// Address List display JSP
List<Address> addresses = (List) request.getAttribute("addresses");
for (Address address : addresses){
//display the address...
}

