users@glassfish.java.net

Re: Problems with 2 persistence units in one persistence.xml

From: <glassfish_at_javadesktop.org>
Date: Fri, 16 Apr 2010 01:22:44 PDT

Update:

If I use the following code and just load one persistence unit out of the two. It seems to work properly:


        EntityManagerFactory emf = Persistence.createEntityManagerFactory("pu-name1");
        EntityManager em = emf.createEntityManager();
        Query DataQuery = em.createNamedQuery("Vc114Data.findByVc114ID");
        DataQuery.setParameter("vc1ID", Id);
        List<Vc114Data> DataList = DataQuery.getResultList();

        int countAgentData = DataList.size();
        System.out.println("Data length: " + countData);

and the syso there gives me the output "Data length: 1

maybe that helps!
[Message sent by forum member 'peter0601']

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