Hi all,
I have a simple but important question...
Lately i have been testing my hibernate search app (EJB 3.0 and SOA) and i discover the next thing:
- I have an entity ejb stateless (ItemEjb) with an entity manager. i create some entities and i get them correctly.
- I have a search ejb stateless entity (SearchEjb) with an entity manager. If i search i dont have the last entity i created in the ItemEjb.
I am thinking that i have two sessions. I am using refresh method...
so my question is what is the right way to share a session between ejbs:
Code:
private ItemEjb...{
...
@javax.persistence.PersistenceContext
private EntityManager em;
...
}
private SearchEjb...{
...
@javax.persistence.PersistenceContext
private EntityManager em;
...
}
Thanks,
pd: if this right, i try to post my daofactory and more to check if everything is right (ejb patterns).
Hibernator,