I need to design an EJB component for messaging system which has to retrive the content from the database in an XML document and output the content in the XML document to the other components ,please do let me know either i use session bean or entity bean for effectiveness and i dont have any UI. My design concederation are Content Catching,Validation of request,Validation of authority to make request,Handling of unavailable Connection/retries.
Sounds like a simple JMS client would work here. Is there any reason you need to implement this functionality in an EJB?
U r right but i need EJB for reusability of that component since that component will be called by other component in the application again and agian,please do let meknwo the design concederation .
Well normally I would put Entity bean for
accessing the database and session bean
to handle business logic.. But if your case is simple
than you need session bean (eliminate entity bean
to get data) to do data validation, formating of database
information to XML ..
Security should be preferably handled through Security
descriptor/realm of EJB ..
Connection Pool/Retries to database needs to be
handled by seperate classes.. But if connection
goes bad than you may choose to retry..
If you are using entity bean than you may not need to do that..
Yeh that sounds fine to me since i have to retrieve data from the databse so i can do it with stateless session bean ,and present it to other components.
please do let meknwo ur feedback
i think when u r going for retrive or insert then there is no need of entity we can use stateless or stateful beans . If u r going for entity bean we r decreasing performane by unnecessary call of callback method . So feel better go for session bean rather entity ..
pl give me feedback ...