try{
Context ctx = getInitialContext();
TravelAgentHome agentHome =
(TravelAgentHome) ctx.lookup("TravelAgentHome");
TravelAgent agent_1 = agentHome.create();
TravelAgent agent_2 = agentHome.create();
boolean x = agent_1.isIdentical(agent_2);
// x will equal true; the two EJB object are equal
CabinHome c_home =
(CabinHome) ctx.lookup("CabinHome");
CabinPK pk = new CabinPK();
pk.id = 101;
Cabin cabin_1 = c_home.findByPrimaryKey(pk);
Cabin cabin_2 = c_home.findByPrimaryKey(pk);
x = cabin_1.isIdentical(cabin_2);
// x will equal true; the two EJB objects are equal
}catch(java.rmi.RemoteException re){re.printStackTrace();}
catch(Throwable t){t.printStackTrace();}