wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies and the fly likes loading from database when application start Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "loading from database when application start" Watch "loading from database when application start" New topic
Author

loading from database when application start

rudra tripathy
Greenhorn

Joined: May 26, 2004
Posts: 25
hello all,
i want to retrive data and put it into in memory.
i am defined a method for it.
i am using ejbcreate() of stateless session bean.
can i call the method directly from ejbcreate()
Abhishek Asthana
Ranch Hand

Joined: Sep 08, 2004
Posts: 146
Hi,
You have not mentioned anything about your server. Any way you can access the database directly from ejbCreate() but it is STRONGLY RECOMMENDED that you don't do so.
Make a helper class which has a function defined that accesses the database and returns result to your ejbCreate(). Call this function from your ejbCreate().
If you have any doubt, please tell me.
Abhishek
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: loading from database when application start
 
Similar Threads
get a reference to EJBObject from ejbCreate() of SLSB
public int ejbCreate() throws javax.ejb.CreateException
Valid operation in ejbCreate for stateless session bean
ejb life cycle
CreateException: Initial beans in free pool