-
1. Re: Lazy loading Stateless session beans
wdfink Apr 11, 2014 2:15 AM (in response to surendrand001)Which server version do you use? What hardware and JVM?
Only MDB's are started directly as they need to be able to handle requests.
SLSB and Entities are initialized on demand if you use it, depend to the pool configuration it might be prefilled.
What do you see that you come to the conclusion the loading is the reason for the slow start?
-
2. Re: Lazy loading Stateless session beans
surendrand001 Apr 11, 2014 2:56 AM (in response to wdfink)I am using JBoss 4.2.2.GA .
From the server & console log I can see that JBoss is spending most of time in following operation
00:49:01,468 INFO [EJBContainer] STARTED EJB: com.mycompany.MyBeanDaoA ejbName: MyBeanDaoA
00:49:01,562 INFO [EJBContainer] STARTED EJB: com.mycompany.MyBeanDaoB ejbName: MyBeanDaoB
00:49:01,640 INFO [EJBContainer] STARTED EJB: com.mycompany.MyBeanDaoC ejbName: MyBeanDaoC
00:49:01,671 INFO [EJBContainer] STARTED EJB: com.mycompany.MyBeanDaoD ejbName: MyBeanDaoD
..
..
...
00:59:01,781 INFO [EJBContainer] STARTED EJB: com.mycompany.MyBeanDaoE ejbName: MyBeanDaoE
Almost all my beans are SLSB
-
3. Re: Lazy loading Stateless session beans
wdfink Apr 11, 2014 3:29 AM (in response to surendrand001)Hmm, not sure whether the pools are really prefilled. It takes only a few ms for each bean.
Maybe your application is huge and the machine slow (or less memory) so the problem is here.
Do you use EJB2 or EJB3?
For EJB2 you might have a look to the standardjboss.xml "* Stateless SessionBean" configuration. There is a container-pool-conf, maybe MinimumSize and MaximumSize helps.
-
4. Re: Lazy loading Stateless session beans
surendrand001 Apr 11, 2014 5:58 AM (in response to wdfink)I am using EJB3. On the fastest hardware I have it takes around 3-4 minutes (still its longer)
as per the logs
00:49:01,562 INFO [EJBContainer] STARTED EJB: com.mycompany.MyBeanDaoB ejbName: MyBeanDaoB
I can see that EJB instances are loaded at the server startup. can we postpone this operation till only when EJB is referred by my class?