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
-
Question about when to use EJB (3 messages)
- Posted by: Kirk Gray
- Posted on: July 06 2004 11:27 EDT
Threaded Messages (3)
- Question about when to use EJB by Tomas Inger on July 06 2004 11:32 EDT
- Question about when to use EJB by Kamati Pura on July 07 2004 00:14 EDT
- Question about when to use EJB by Race Condition on July 07 2004 15:16 EDT
-
Question about when to use EJB[ Go to top ]
- Posted by: Tomas Inger
- Posted on: July 06 2004 11:32 EDT
- in response to Kirk Gray
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 -
Question about when to use EJB[ Go to top ]
- Posted by: Kamati Pura
- Posted on: July 07 2004 00:14 EDT
- in response to Tomas Inger
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 -
Question about when to use EJB[ Go to top ]
- Posted by: Race Condition
- Posted on: July 07 2004 15:16 EDT
- in response to Kirk Gray
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.