The second approach would be the best one.

In general a good patterne is SessionBean=Business Rules and
EntityBean=Persistence.

You also have to keep in minbd that enterprise beans are not allowed to
do any IO by themself, they have to rely on ressources (found in JNDI)
to do the actual IOs.

--- Sveta Mordkovich <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> We have a server-side object which has to perform the following
> sequence
> in its update() method:
> - update the DB row it represents
> - perform some communication with an external device
> - update the DB row according to the success of the previous step
>
> The two DB updates should not be performed in one transaction.
>
> As far as I understand there are two design solutions:
> 1. implement this object as an Entity Bean using BMP in which
>    the object's update() method will explicitly perform the DB
> updates.
>    (and use TX_NOT_SUPPORTED for the update() method).
> 2. Use an entity bean to implicitly handle the object persistence
>    and wrap it with a statefull session bean which will perform the
>    logic described above.
>
> It seems to me that the second option is preferable, but then
> the question is how will the session been handle multiple
> concurrent invocation of update() method keeping in mind
> that the method does not make use of transaction to perform
> the 2 DB updates.
>
> Any comment will be highly appreciated,
>
> Sveta
>
>
===========================================================================
> 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".
>
>
>
>

=====
Emmanuel Pirsch
Sun Certified Java Programmer
Unite for Java! - http://www.javalobby.org
---
"Imagination is more important than knowledge."
   - Albert Einstein

__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

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