Seeking Opinion from EJB experts


EJB programming & troubleshooting: Seeking Opinion from EJB experts

  1. Seeking Opinion from EJB experts (5 messages)

    I will get straight into my problem...

    My application consists of a bean that needs to access methods on a set of classes that accept vectors as input and provide vectors as output

    My problem is how to pass these vectors over the wire and be able to read the vectors returned by the classes. I need to know the length of each element to be able to paint on the front end properly.


    Threaded Messages (5)

  2. Seeking Opinion from EJB experts[ Go to top ]

    Are we talking Vectors as in java.util.Vector or vector as a coordinate?

    Either way, as long as your objects implement Serializable, you should be able to pass the objects along the wire.
  3. Seeking Opinion from EJB experts[ Go to top ]


    thanks for your reply...Yes I am referring to java.util.vector.

    To compound the problem I need to invoke methods on java classes before I pass the vectors to these methods...
    reflection merely returns the name of the methods exposed by the class.

    Also, would it be a good idea to let classes do the commit on the DB or use my bean to perform the commit / roll back
  4. Seeking Opinion from EJB experts[ Go to top ]

    Can you give an overview of your logic?

    What I read is something like:

    Client -> EJB -> VectorHandler

    Where VectorHandler is your class that accepts and returns the Vectors.

    So do you not actually have the details of the object before you get them? I am not sure I understand.

    I would handle the transactions in your bean, based on errors or results from the classes called. This keeps all your transactional logic in the one place.

  5. Seeking Opinion from EJB experts[ Go to top ]

    Thanx for ur msg Toby,
    the application logic is such


    this Vector handler needs to invoke method on remote classes and pass client input as parameters. The class then returns the output as multiple Vectors which are elements in one output Vector.

    Could I dispense with Vectors and instead use String Arrays as elements in this output vector...I read that the class array is not Serializeable...will it be a problem? Especially if the EJB and the classes are on separate weblogic instances but in the same machine?

  6. Seeking Opinion from EJB experts[ Go to top ]

    Okay, so the access path is Client -> Servlet -> EJB -> VectorHandler ->...remote call to another WLS instance ...-> Remote EJB ?

    Anyway, whatever objects you pass in your Vector, make sure that they implement the interface. Secondly, make sure that the home/remote interfaces of the Remote EJB (on the 2nd WLS instance) and the objects being passed via the Vectors are in the classpath of your caller EJB. Otherwise you'll get the ClassNotFoundException as well.