Hi,

Only bean managed transaction can go for a long time period or it can stay
"alive" between calls, because you are responsible when it will commit or
abort the transaction.

I think most application that use distributed architecture cannot afford to
keep the transaction for too long, it should be quick open and commit/abort
transaction, if not it will slow things incredibly.

The main princinple for transaction is get in and get out quickly as it has
got to do with concurrency controlt too.

Just my 2c.

Cheers
Nanik




>From: miki <[EMAIL PROTECTED]>
>Reply-To: miki <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Entity bean with a long-term connection
>Date: Thu, 28 Feb 2002 10:03:16 +0900
>
>J2EE tutorial says that we can keep a long-term connection even
>for a entity bean. That means that it keeps the connection for its
>entire life. I am frustrated with this description because I think
>this doesn't work with distributed transaction.
>
>Please read this:
>   http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/Resources3.html#65118
>
>EJB 2.0 section 17.3.1 says "An Entity Bean must always be
>designed with container-managed transaction demarcation".
>So we cannot control the transaction demarcation explicitly
>even for the long-term connection case.
>
>According to JTA(Java Transaction API) spec, calling
>Connection.close() send a notification to an application server,
>and this causes the following sequence:
>
>  1. application closes the connection.
>  2. application server get a closing notification
>  3. application server calls Transaction.delistResource().
>  4. transaction calls XAResource.end().
>
>With distributed transaction, therefore, the long-term connection
>is never closed until the end of the life. Thus the application
>server doesn't have a chance to inform the end of transaction to
>the resource manager before returning ejb methods.
>
>IMHO, the entity bean with long-term transaction  works only with
>one of the following conditions:
>
>   - local transaction
>   - NotSupported for distributed transaction.
>
>I just want to clear up a "guideline for writing BMP entity beans".
>Before sending a comment to J2EE tutorial team, I'd like to hear
>the expert's ideas.
>
>Thank you,
>Miki
>
>----------------------------------------------------------------
>Fusayuki Minamoto
>Solution Technology Development Unit
>Solution Development Center
>Fuji Xerox Co., Ltd.
>
>===========================================================================
>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".
>


_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.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