Discussions

EJB design: Question about when to use EJB

  1. Question about when to use EJB (3 messages)

    Hello All,
    I appreciate any help you can provide on this:

    I have a web app, and we have some customer-specific data that we want to read from an xml file once, and store in a stateless fashion, as that data is accessed every time someone logs on to the system. EJBs are overkill for this, correct? What would the best way to do this be, in your opinion?

    Thanks!
    -Kirk
  2. Question about when to use EJB[ Go to top ]

    Hi!

    An EJB is definitely overkill! In my opinion, one should use EJBs when you need the transaction monitoring and/or thread safety.

    In this case I recommend you to make a Singeton with a synchronized getInstance() method. Load the file on the first request (using an if instance==null condition) and store the data in the XML file in some data structure suitable for simple access from your application.

    Regards,
    Tomas
  3. Question about when to use EJB[ Go to top ]

    Hi

    Just before u go ahead with the singleton solution,
    take a look at

    http://www-106.ibm.com/developerworks/webservices/library/co-single.html

    Cheers
    Ajay
  4. Question about when to use EJB[ Go to top ]

    Hello All,I appreciate any help you can provide on this:I have a web app, and we have some customer-specific data that we want to read from an xml file once, and store in a stateless fashion, as that data is accessed every time someone logs on to the system. EJBs are overkill for this, correct? What would the best way to do this be, in your opinion?Thanks!-Kirk
    Use EJB whenever you damn well please. Do you have EJB experience on your resume? If not, use EJB and gain the experience.