I am using EJB Container Managed Bean database handling.I am not able to begin transaction and end transaction.EJB handles this.Persistence provider is hibernate.
When I want to execute an sql query , it does not return to newest state from database.
I want to get entities whose status is WAITING, but although some entities is not in WAITING state, they are retrieved execution of query.I think hibernate does not go to database for newst state.
I tried Query.setHint(String,Object), em.clear and some other things,But I am not able to.
O am dealing with this problem for one week.I tried anything.
I created a new bean, added my method that retrieves entities whose status is Waiting as business method of that bean.I added @TransactionAtrribute(REQUIRES_NEW) annotation to declaration of method, this solved my problem