1 Reply Latest reply on Feb 21, 2005 3:13 PM by sviluppatorefico

    Can session beans interact with each other??

    fifihead

      Hi

      i am using two databases A and B, one to pull data from (call it A) and the other to store this data (call it B).

      my application is supposed to generate reports
      so i have a fields EJB and a report EJB and 2 corresponding session beans

      These beans have a many to many unidirectional relationship
      a report has many fields and fields can be associated with many reports
      so i have a link in the application DB to represent this (B)

      I am accessing database A using JDBC in a Session bean called dataAccess

      How can i populate the fields EJB using the data in database A?

      Does the dataAccess session bean have to talk to the fields session bean?
      Can two session beans talk to each other and pass data to each other?

      please help!

        • 1. Re: Can session beans interact with each other??
          sviluppatorefico

          hi.....you must specify the jndi-name for each session bean, so you can to call the other with a new InitialContext().lookup(jndi-name) writing in the code. The jndi-name you can to specify or in jboss.xml (with the tag jndi-name) in META-INF or in ejb-jar.xml (with the tag ejb-ref or ejb-local-ref if it's local) always in META-INF of your application