users@glassfish.java.net

Re: Not Connecting to Database

From: <glassfish_at_javadesktop.org>
Date: Thu, 23 Aug 2007 11:39:42 PDT

Okay, I tried to use the EMF. This is my Session Bean declaration:

[code]
@Stateless(mappedName="ejb/MyEntityManager")
@TransactionManagement(TransactionManagementType.CONTAINER)
@Resource(name="jdbc/<databasename>", type=javax.sql.XADataSource.class )
public class MyEntityManagerRemote implements MyEntityManagerIFRemote {
        @PersistenceUnit(unitName="MYEJBPU")
        private EntityManagerFactory entityManagerFactory;
        private EntityManager entityManager;
        //_at_PersistenceContext private EntityManager entityManager;
        
        

        public MyEntityManagerRemote(){
                
        }
        
        @PostConstruct
    public void initialize(){
            entityManager = entityManagerFactory.createEntityManager();
    }
        
        @PreDestroy
        public void cleanup(){
                if(entityManager.isOpen()){
                        entityManager.close();
                }
        }
[/code]

I am still getting the same error....... :-( Grrrrr.....


Thanks for reading my post.....


Russ
[Message sent by forum member 'russ_ray' (russ_ray)]

http://forums.java.net/jive/thread.jspa?messageID=232371