Hi Sanjay,

1.  This is kind of correct.  But you would not call ejbStore yourself.
During the life-cycle of your bean the container calls ejbStore, this
includes when invoking a transactional method ( if you're just illustrating
the point - I apologise ).

You're right performance here may be a problem.  The performance issue
will be greater if you're calling the entity beans directly from a client.
Possible approaches are,
        1.  Using Session beans to access your entity beans
        2.  Using a single entity bean to wrap your collection of data
        3.  Use Session beans to act on the data directly
        4.  Pass your primary keys around and instantiating your entity beans
            as required

- these are just some of the approaches discussed in earlier threads by this
group.
Take a look at the archives for more info.


2.  Firstly an entity has ( unique ) identity - in EJB this identity is
in the form of a primary key.  With this in mind, a consideration to take
into account is whether this data qualifies as entities.  From what you've
said so far this does not look like the case.  If this still is the case,
can you make use of views to help you achieve this unique-ity i.e. join
to another table - no good for updates though :-(.  My relational-SQL
knowledge is a little rusty, so I may be off the mark.



Thanks,

Jazz.

-----------------------------------
Jasbinder Singh Gill (Consultant)
Versant LTD
Tel: ++44 (0)1256 366540
Mobile: +44 (0)958 904 536


Sanjay Nambiar wrote :

>
> Hi All,
> There are two questions
> 1>In case of multiple update and delete is the following approach correct:
> first select records based on primary key. then update/delete record
> one by one.
> ie.
> while(there are records)
> {
>    ejbFindByPrimaryKey()
>    ejbStore()  /  ejbRemove()
> }
> I believe that the performance would be pathetic in the above case.Any
> pointers of a better solution
>
> 2>I have an application in which some tables do not have primary keys
> defined.In this case I would be unable to implement ejbFindByPrimaryKey()
> though I could still declare the method with an empty body.
> How should I handle Multiple Updates and Deletes in this case.
>
> SANJAY Nambiar
> > ITL Infosys (West)
> PUNE DC
> > __________________________________________________
> > Powered by intellect. Driven by values.
> PH : 647420-21 EXTN : 2036 Mail Id  [EMAIL PROTECTED]
> "Live out each day as if, it is the first day you have ever seen and the
> last day you would ever see....."
>
> ==================================================================
> =========
> 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".
>

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