×

Loading...
Ad by
  • 推荐 OXIO 加拿大高速网络,最低月费仅$40. 使用推荐码 RCR37MB 可获得一个月的免费服务
Ad by
  • 推荐 OXIO 加拿大高速网络,最低月费仅$40. 使用推荐码 RCR37MB 可获得一个月的免费服务

questions about ejb entity bean life cycle

本文发表在 rolia.net 枫下论坛Hi, all
I'm studing EJB using the book Mastering EJB 3rd edition. Now I have some questions about entity beans' life cycle

1, When client call home object's Create(), the home object delegates it
to cantainer. Cantainer pulls one bean instance from pool and put it
in ready state.
The bean instance does centain initializtion and return PK.
The container uses the PK create a local object and return it to client.
My question is as follow:
-- 1)when the bean instance is pulled from pool, it isn't bound with any
data. How could it know how to perform ejbCreate()?
-- 2)The ejbPostCreate() is right after ejbCreate(). Which function
performs system recources, like sockets and connections,
allocation?
-- 3)The ejbPostCreate() will be called befor or after
home object Create()?
2, When client call home object finder(), the home object asks a bean
perform ejbfinder() to return all PKs matching the criteria. The
container creates and returns local objects according to PKs
-- 1) What bean takes care the finder()? A random one?
-- 2) What happens if there's no such paticular type of bean in the
ready state? Does the container invoke ejbCreate()?
-- 3)The local object associates with data on database not the bean
instance. Is this understanding right?

Thanks更多精彩文章及讨论,请光临枫下论坛 rolia.net
Report