[jboss-user] [EJB 3.0] - EJB 3.0 with Stateless Session Bean as instance variable

wichkabashir do-not-reply at jboss.com
Wed Apr 15 22:22:19 EDT 2009


Example.
@MessageDrivenBean 
public class CalculatorMDB { 
@EJB Calculator cal; 
onMessage()
{
...
}

} 

I have injected a stateless session bean instance in MDB and  that there are 5 mdbs in the pool but every time mdb receives a message different instance of stateless session bean is created. Is there way to make one to one instance mapping so that every invocation of mdb doesn,t create a new session bean instance. It seems mdb resets it's instance variables and creates new instance variable for every message it gets from jms topic. 

Suggestions appreciated. 
Ahmed 

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4225774#4225774

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4225774



More information about the jboss-user mailing list