Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    #16
    No problem: CWWJP0029E error code (with some googling) is enough to understand that server can not find (does not have access to) persistence.xml.

    Yes, that's right. You can not "borrow" persistence.xml from other module. Same is true for EMFProviderCMT.

    Moreover it is not enough have access to persistence.xml. You have to have access to actual JPA entity classes (JPADataSource should be able to create new entity instance).

    Looks like you will have to make changes to structure of your project because of EJB class-loading standards (not because of SmartClient).

    Regards,
    Alius

    Comment


      #17
      Ok.

      I have access to actual JPA entity classes, so JPADataSource is able to create new entity instance.
      Thank you Alius, now the use of EMFProviderBMT is clear.

      Now, about EMFProviderCMT you said:
      - EMFProviderCMT looks up transaction in java:comp/EJBContext.
      I have a question:
      - EMFProviderCMT class is used in the WEB module. How can it lookup java:comp/EJBContext which is visible only by EJB ?



      Thank you,

      Giervella
      Last edited by giervella; 11 Jul 2012, 01:49.

      Comment


        #18
        Hi,

        EMFProviderCMT should be used in cases when you want to call JPADataSource functionality from within EJB and want to join same transaction. It should be used/accessible in EJB module.

        Regards,
        Alius

        Comment


          #19
          Context 'java:comp/EJBContext' is visible only into an inizialized EJB, which i can call only through a local or remote interface.

          In the moment EMFProviderCMT can be used/accessible in EJB module, how can i make 'java:comp/EJBContext' visible to it?


          Thank you,

          Giervella

          Comment


            #20
            In your EJB execute following:
            Code:
                    DataSource ds = DataSource.forName("myJPADataSourceName", req);
                    DSResponse resp = ds.execute(req);
            Alius.

            Comment


              #21
              I tried and it works.
              Now EMFProviderCMT is clear.

              Thank you Alius for your useful assistance.

              Giervella
              Last edited by giervella; 17 Jul 2012, 02:08.

              Comment

              Working...
              X