Dmitry Panov wrote:

> I'm new in EJB and have some question.
>
> I need to pass an uncommited CMP bean from one session
> to another or to the servlet. How can I do it? May be
> I need some "interface" session?

It is not possible to solve the problem you are working on in the way you
describe. If the CMP bean is "uncommitted" this means that the ACID
transaction (see note below) is still in-flight. The uncommitted data can
only be accessed from within that transaction, and there are no services
that allow other clients to join an in-flight transaction.

Most likely you are trying to use uncommitted data to keep track of
work-in-progress (WIP) data, for example data built up by a series of user
interactions that has not yet been sent to the database. This use of ACID
transactions is theoretically possible but undesireable for several
reasons:

** ACID transactions should be kept short to avoid holding database locks
for long periods. They should not wait for user input

** ACID transaction have a binary outcome - they either succeed completely
or fail completely. Usually, the outcome of a series of user interactions
is more complex, with partial failures not causing the whole to fail.

For these reasons you should use a session bean for WIP data rather than an
uncommitted entity bean. (Yes, I know this tends to drive business logic
out of the entity bean where it strictly belongs, but that is where we are
today with distributed object technology today. Not all the pieces are in
place.)

If you need to pass WIP data to another user (which is a common telephone
call centre requirement) then my advice would be to write it to a special
database for the purpose and pass the other user the database key so that
they can retrieve it.

- - - - - - - - - - -
Note: ACID transactions are the foundation of nearly all high performance
transaction processing systems. ACID stands for Atomic (all or nothing),
Consistent (can include multiple updates to multiple resources) Isolated
(other transactions cannot see uncommitted data) Durable (written to
non-volatile memory). For more information search for ACID on
http://whatis.com/nfindex.htm
- - - - - - - - - - -


Ian McCallion
CICS Business Unit
IBM Hursley
[EMAIL PROTECTED]
Tel: ++44-1962-818065
Fax: ++44-1962-818069

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