Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Can I set EJB load order?  RSS feed

 
Dan Bizman
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a way to set the load order of EJBs? (Similar to how servlets can be given a load order)
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36406
454
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dan,
I suspect the application server loads the EJB modules in the order they are defined in the application.xml. This isn't guaranteed through.

What are you trying to accomplish through the load order? Do the EJBs depend on each other?
 
Valentin Tanase
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I don�t know about other containers, but weblogic allows you to define the load order for each component. It is rather trivial to set the loading order for your deployed applications and one can figure it out pretty easily, using the weblogic console. Jane is right though and you should explain why you need to set the deployment order, because if I were you I�d be little bit concerned to release an application whose logic depends upon the order in which the ejbs are loaded.
Regards.
 
Dan Bizman
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jeanne Boyarsky:
Dan,
I suspect the application server loads the EJB modules in the order they are defined in the application.xml. This isn't guaranteed through.


That would have made sense, but unfortunately that's not the case. I do know that in weblogic and websphere you can set the load order in the GUIs, but I was wondering if there was a way that the EJB spec specified.
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The EJB spec says nothing about the load order of EJBs. Nor does it say anything about how many instances will be created, how many containers will be created, how many class loaders will be created, etc. All of this is vendor-specific.
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36406
454
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jeanne Boyarsky:
What are you trying to accomplish through the load order? Do the EJBs depend on each other?

I'm still trying to figure out what you are trying to accomplish. I can't imagine a scenario where the load order would matter. You can't do anything until all the beans load and the app server is started anyway.
 
Dan Bizman
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When some of my beans are entered into the pool (i.e. instantiated as objects but NOT as entities), they make access of another bean - a message bean. That other bean is in a different jar file, so when it's loaded before these beans, they CAN make use of it.

I did figure out how to set the load order, though it's not the same for each app server, but then there's a lot of stuff that isn't the same for each app server (i.e. in deployment and configuration).
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This looks very strange - what are you trying to do?
 
Ramanath Shanbhag
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Dan,
Can you plz tell me how to set the load order esp in Weblogic.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!