EBasicVer bean = new EBasicVer();
bean.setName("Please Delete Me");
Ebean.save(bean);
SpiTransaction transaction = (SpiTransaction)Ebean.beginTransaction();
try {
EBasicVer bean2 = Ebean.find(EBasicVer.class, bean.getId());
Assert.assertNotSame(bean, bean2);
EBasicVer bean3 = Ebean.find(EBasicVer.class, bean.getId());
// same instance from PersistenceContext
Assert.assertSame(bean2, bean3);
Object bean4 = transaction.getPersistenceContext().get(EBasicVer.class, bean.getId());
Assert.assertSame(bean2, bean4);
Ebean.delete(bean2);
Object bean5 = transaction.getPersistenceContext().get(EBasicVer.class, bean.getId());
Assert.assertNull("Bean is deleted from PersistenceContext",bean5);
EBasicVer bean6 = Ebean.find(EBasicVer.class).where().eq("id", bean.getId()).findUnique();
Assert.assertNull("Bean where id eq is not found "+bean6, bean6);