Hi, I have a questions..
EAR
- War
- EJB
War is a GWT application.
In the GWT I Inject a interface for a StatelessSessionBean.
Code:
@EJB
private PrintProviderMockSBBeanLocal ppmockSBBeanLocal;
The PrintPoviderSessionBean loads some data from the database.
Code:
@Override
@TransactionAttribute(TransactionAttributeType.SUPPORTS)
public ArrayList<PrintProviderMockEnt> getPrintProviders() throws BusinessException, SystemException {
Query query = manager. createQuery("from PrintProviderMockEnt");
ArrayList<PrintProviderMockEnt> resultList = (ArrayList<PrintProviderMockEnt>) query.getResultList();
return resultList;
}
and gets returned to the GWT class..
Here I call some methods on the objects... and get a
Quote:
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role
But shouldn't the objects been detached by now ???
I also tried this...
Code:
@Override
@TransactionAttribute(TransactionAttributeType.SUPPORTS)
public ArrayList<PrintProviderMockEnt> getPrintProviders() throws BusinessException, SystemException {
Query query = manager.createQuery("from PrintProviderMockEnt");
ArrayList<PrintProviderMockEnt> resultList = new ArrayList<PrintProviderMockEnt>();
ArrayList<PrintProviderMockEnt> tmp = (ArrayList<PrintProviderMockEnt>) query.getResultList();
for (PrintProviderMockEnt printProviderMockEnt : tmp) {
manager.detach(printProviderMockEnt);
resultList.add(printProviderMockEnt);
}
return resultList;
}
But I still get the
org.hibernate.LazyInitializationException: