For Programmers: Free Programming Magazines  


Home > Archive > Java Beans > March 2004 > home.create and ejbCreate









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 home.create and ejbCreate
dolphinn

2004-03-19, 8:46 pm

In the book Mastering Enterprise Java Bean 2nd Edition by Ed Roman,
it says the create and remove methods of a Home Object is responsible for
create and remove EJB Object. They are called by clients.
The ejbCreate and ejbRemove methods are implemented in the Bean class,
and called by container. The bean instance will be created or removed
by these two methods.

When a client call create and remove methods on a Home Object, the
bean instances are not necessarily be created or removed, because the
container may caching some method-ready bean instances. The container
will control when these bean instances should be created or reomved.

My question is "is this true"?
Because in all the EJB examples, I saw the ejbCreate or ejbRemove
were always called when client called a Create or Remove home method.
I am wondering if the Home.Create and Home.Remove are actually
bonded with ejbCreate and ejbRemove methods?

Anyone had experience with this?
Thanks.



Marek Lange

2004-03-19, 8:46 pm

dolphinn wrote:

> In the book Mastering Enterprise Java Bean 2nd Edition by Ed Roman,
> it says the create and remove methods of a Home Object is responsible for
> create and remove EJB Object. They are called by clients.
> The ejbCreate and ejbRemove methods are implemented in the Bean class,
> and called by container. The bean instance will be created or removed
> by these two methods.
>
> When a client call create and remove methods on a Home Object, the
> bean instances are not necessarily be created or removed, because the
> container may caching some method-ready bean instances. The container
> will control when these bean instances should be created or reomved.
>
> My question is "is this true"?
> Because in all the EJB examples, I saw the ejbCreate or ejbRemove
> were always called when client called a Create or Remove home method.
> I am wondering if the Home.Create and Home.Remove are actually
> bonded with ejbCreate and ejbRemove methods?


This is container dependant. In general a home.create() call by the
client can cause an ejbCreate() on the bean but there is no must. Bean
configuration issues also influence this behaviour.

-marek
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com