Hi,

Manisha Menon wrote:
>
> Hi all,
>
> I just got subscribed to ejb mailing lists and totally
> new to ejb and to this group.
>
> So, pardon me if the doubts which I got are stupid/
> very basic level.
>
> I request you to also show me pointers, where I can
> get more information.
>
> 1. How do you map a entity container managed
> bean-field, which is not of java primitive type, but
> an instance of a composite class to database. The
> bean-field may require mapping to a table than a
> column. How can you do it ? Can I assume this is the
> limitation of CMP ?
>
> eg., for primitive data type mapping, which is fine.
>
>  <object-link>
>       <bean-field>beanyear</bean-field>
>       <dbms-column>dbyear</dbms-column>
>  </object-link>
Compound container field are a limitation in ejb1.1 but the problem is
beeing solved with ejb2.0

>
> 2. Why does the multiple-result finder methods in the
> home interface of entity bean always return either a
> enumeration (JDK 1.1) and collection (JDK 1.2)
> interfaces ? Can't it return a Vector, HashMap classes
> ? Is there any restriction for the home interface ?
No. First HashMap doesn't make sense here. Returning Enumeration or
Collection is a contract (see 9.1.8.2 ejb-spec1.1) . Allthough it won't
be difficult to implement container that accept their subclasses. Some
Containers might even be doing that now. Jus try and post your result.

>
> 3. Data synchronization : Does the container-provided
> data synchronization for entity beans through
> ejbLoad() and ejbStore() is efficient ? When will
> these methods be called ? Does every vendor will have
> their own way of doing it or is there any standards
> again ? My question is, whether these methods will be
> called after every update of a field or only after
> complete update of all the fields in the bean ? I
> couldn't understand this concept. How do the container
> know the data in the bean is dirty ?
- ejbLoad is called either when a Bean is activated or every time a bean
got involved for tha first time into a transaction. During a started
transaction is on, ejbLoad isn't called (no matter whatever changes on
the bean state).
- ejbStore is called at the end of each transaction so the bean can
write it state to the DB. It doesn't need to be called before
passivation.
- Allthough they are only called when starting and ending a transaction,
they are still expensive because the transaction could only haved caused
readonly access to the bean. The use of setDirty()-like methods to avoid
rewriting unchanged state to the DB is jet solved in a container
(application) dependent way.
- I'm also expecting a future ejb-spec release to address trhis issue.

>
> <vendor> I heard that there is a flag in weblogic
> isModified(), which will determine if the data is
> dirty or not ? I am not clear about this one too
> <vendor>
That's what I've been telling above, but for CMP-Bean, beacause it'd be
expensive for the container itself to check whether the bean state
changed.

>
> 4. What is the necessity of ejbPostCreate() ? Is there
> any thing to be coded here for BMP ? What is the
> significance of this method ?
ejbCreate() just give you the possiblity to insert the entity's row in a
DB-Table. The container can only create the (logical) Bean instance (and
if necessary the corresponding proxy) if the PK has been successfully
returned from ejbCreate() (BMP). Such method like get ejbObject(),
getPrimaryKey() cann't be called in ejbCreate(). So ejbPostCreate() give
you the opportunity call them before beginning with the processing of
client requests.

> 5. Can't you map an entity bean with CMP to more than
> one table ? Again is that the limitation ? Whether I
> need to go for BMP in this case ? Can someone show the
> possible ways to do this with CMP ? Whether all ejb
> containers support O-R mapping tools with CMP ?
ejb1.1 doesn't require Container providers to support EBs that map to
multiple tables. For writting portable multi-table EBs now, use BMP.

> 6. Dependent objects : I am sure that everyone of you
> is very familiar with dependent objects. Now when to
> instantiate this dependent objects. Assume that I am
> going for BMP. Now in which method should I
> instantiate the dependent objects ? In ejbLoad() ? In
> bean business methods ? How to do lazy initialization
> in this case ?
It depend on what you are intending to do with the dependent object.
Just keep it uninitialized till the first use. You can do that adding a
private getDependentObject()-factory method to your bean that controls
the creation of your dependent.

> 7. Association : How to add associations between two
> entity beans ? I am totally unclear about this.
read the 14.3.1.2 of ejb-spec1.1 and repost your question if necessary.

/Francis
--
[EMAIL PROTECTED]

MATHEMA Software GmbH
N�gelsbachstra�e 25 b
91052 E r l a n g e n
D e u t s c h l a n d
Tel +49(0)9131/8903-0
Fax +49(0)9131/8903-55
http://www.mathema.de

===========================================================================
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