WebSphere Application Server - wrong using EJB??

This is Interesting: Free IT Magazines  
Home > Archive > WebSphere Application Server > January 2005 > wrong using EJB??





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author wrong using EJB??
bijoWang

2005-01-21, 7:51 am

there are some codes form someone I dont understand, can anyone help me out
?
the class Call will run on the same VM as the CMP entity bean Subscriber.
what I am not sure is the call in method f2() , i.e. s.setName() will really
wirte data to databank, since the lookup was done in getScriber(), and not
visible in f2()!

Am I right ? thanks a lot.



public class Call {

pubic void f1(){
Context jndiContext = new InitialContext();
}

public void f2 (){
Subscriber s = getSubscriber(); // 1
s.setName(); // 2
}
private Subscriber getSubscriber(){
SubscriberHome sHome = (Subscriber)jndiLookup("SubscriberEJB"); // 3
Subscriber sb = sHome.fineByPrimaryKey(1);
}
}




Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com