On Tue, 13 Feb 2001, Narinder Singh wrote:

> Hi 
> I need to call methods of a Session Bean from another bean. 
> I was previously using the following method for this. 
> Context jndiContext = new InitialContext(); 
> InterestHome interestHome = (InterestHome
> )jndiContext.lookup("InterestBean"); 
> Interest interest = ((InterestHome)interestHome).create(); 
> interest.calculateInterest(); 
the point of doing this is that you call your bean thru container. at some
point container injects services such as tx mgmt, resources pooling etc
etc. that said, using method below, you need to code all of that services 
yourself which defeat the container purporses..

> I have found that this can be done in another way also. 
> InterestBean interest = new InterestBean(); 
> interest.calculateInterest(); 
> I have tested both implementations on jboss. 
> The second method is much faster than the first one. but I doubt whether it 
> is ok to use the second method. 
> Can anyone tell me if I can use the second method without any problems (such
> as transaction handling), 
> or what are the problems in using the second method. 

> Regards 
> Narinder. 
> 
> 
> --
> --------------------------------------------------------------
> To subscribe:        [EMAIL PROTECTED]
> To unsubscribe:      [EMAIL PROTECTED]
> List Help?:          [EMAIL PROTECTED]
> 



--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
List Help?:          [EMAIL PROTECTED]

Reply via email to