}
public void testDeadLock()
throws Exception
{
EnterpriseEntityHome home = (EnterpriseEntityHome) new InitialContext().lookup("nextgenEnterpriseEntity");
try
{
EnterpriseEntity A = home.findByPrimaryKey("A");
}
catch (ObjectNotFoundException ex)
{
home.create("A");
}
try
{
EnterpriseEntity B = home.findByPrimaryKey("B");
}
catch (ObjectNotFoundException ex)
{
home.create("B");
}
Thread one = new Thread(new RunTest("AB"));
Thread two = new Thread(new RunTest("BA"));
one.start();
two.start();