2 Replies Latest reply on Jan 30, 2006 3:11 AM by morenito9000

    Session Bean reads a XML file

    morenito9000

      Hi all,
      in my application I read infos from a Postgres DB
      using this architecture:

      Stateless Session Beans + DAO classes

      (inside DAO classes I wrote the SQL code to
      retrieve infos from the DB).

      Now I have to retrieve other infos from a XML file.

      The question are:

      1) Is it correct that a Session Bean reads infos
      from a "normal" file or it must must be connected
      only to a database ?

      2) There are differences, for what concerne question n.1,
      among Session Beans and Entity Beans ?

      "JBoss runs on a linux server and PostgresDB on another
      linux server, but is simple to say to JBoss where PostgresDB is.

      If the file resides on a server different from
      the Server Linux where JBoss runs, how can
      I read the file ?

      Thank you in advance
      Moreno

      p.s. sorry for my english :-)

        • 1. Re: Session Bean reads a XML file
          fabcipriano

          Read files in EJB is not J2EE compliant, see EJB 2.1 doc item 25.1.2

          But if this is necessary only God can stop from read files.

          • 2. Re: Session Bean reads a XML file
            morenito9000

            "An enterprise bean must not use the java.io package
            to attempt to access files and directories in the file system"

            This EJB spec. sounds like a "condemnation" :-)

            The problem is that I can't directly manage
            infos I need (they are passed to me by other people
            in my company and they don't allow a direct access
            to "their" DB. They prepare every day a XML version
            of DB infos).

            Thank you fabcipriano.

            Moreno