[jboss-user] [JBoss Seam] - Re: the TransientObjectException with <s:convertEntity />
filosganga
do-not-reply at jboss.com
Tue Sep 18 05:10:08 EDT 2007
So, I discovered some problem:
The view presentation appened in a different hibernate session. if i use a stateless bean to load the selectItems entities, using the EntityManager component of Seam, it work fine.
But I have my Daos Stateless EJB, and if i use them i receive same error.
Anyone can help me?
This is the correct code:
| @Name("gruppoService")
| @Scope(ScopeType.STATELESS)
| @Stateless
| public class GruppoServiceBean implements GruppoServiceLocal {
|
| private AccountManager accountManager;
|
| /**
| *
| */
| public GruppoServiceBean() {
| // Empty
| }
|
| @EJB
| public void setAccountManagerLocal(AccountManagerLocal accountManagerLocal){
| this.accountManager = accountManagerLocal;
| }
|
| @SuppressWarnings("unchecked")
| public List<Gruppo> listGruppi(){
| Query query = entityManager.createQuery("from Gruppo as gruppo");
|
| return (List<Gruppo>)query.getResultList();
|
| }
|
| }
|
While this code cause Error. The AccountManager is a Stateless EJB.
| @Name("gruppoService")
| @Scope(ScopeType.STATELESS)
| @Stateless
| public class GruppoServiceBean implements GruppoServiceLocal {
|
| private AccountManager accountManager;
|
| /**
| *
| */
| public GruppoServiceBean() {
| // Empty
| }
|
| @EJB
| public void setAccountManagerLocal(AccountManagerLocal accountManagerLocal){
| this.accountManager = accountManagerLocal;
| }
|
| @SuppressWarnings("unchecked")
| public List<Gruppo> listGruppi(){
| return accountManager.listGruppi();
| }
|
| }
|
I've set this property on persistence.xml:
and my components.xml:
<persistence:managed-persistence-context name="entityManager"
auto-create="true"
persistence-unit-jndi-name="java:/EntityManagerFactories/siccr" />
It's right?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4085369#4085369
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4085369
More information about the jboss-user
mailing list