Hi Everyone, been lurking for some time, picked up some good stuff.
Wanted to add my two cents to this thread, if I may.

I am using the constructor in my entity beans to carry out tasks that are
relevant to the setup of how the entity will interact with its
environment; things like looking up the DataSource, finding the home
interfaces for dependant entities, and such.  Plumbing work, really.
There are probably other places to put these things, as well.  Suggestions
welcome.

You should not put specific tasks that are part of the lifecycle of an
entity in its constructor, as there is no guarantee that the constructor
will be called at any time other than its instanciation (because of
instace pooling, you don't know if you're getting a new bean or a
previously used one).  So I have to agree with Dmitri, see if its really a
entity task or bean management task and determine from there.

Louis


On Fri, 15 Mar 2002, Dmitri Colebatch wrote:

> you might be able to, depending on the resources you have in mind.
> what you should (tm) be doing, is say in a stateless session bean, put
> the "constructor code" in ejbCreate() instead.
>
> hth
> dim
>   ----- Original Message -----
>   From: Suhel Ahmed
>   Subject: How can we exploit constructors in E-Beans
>
>
>   So guys ,can i use beans default constructor to initialize my bean
> with some data or resources.  in this case what are the limitations i
> have to keep in mind by which every thin will go smooth,.  any comments
> or suggestions
   -Suhel

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to