Hello Dave
Can you tell me which website to look for reviewing your presentation.
Regards,
Atul
-----Original Message-----
From: A mailing list for Enterprise JavaBeans development
[mailto:[EMAIL PROTECTED]]On Behalf Of Dave Wolf
Sent: Thursday, August 17, 2000 12:45 AM
To: [EMAIL PROTECTED]
Subject: Re: Transaction for entity and Session Bean.
There is no way to really answer that question. It completely depends on
your application. You might review my presentation from JavaOne on Advanced
Transaction Processing (TS988).
I use the following simple example of a banking transaction. I have a
Teller stateless SB, and Account stateless SB and a CustomerAccountEntity
EB.
EntityBeans can only use a CMT. Generally these would be marked as supports
transaction as the individual actions of an entity bean can be considered
atomic. For instance, in my banking example, the calls to setBalance() are
atomic. They are their own single unit of work and if run alone do not need
a transaction, hence supports is a resonable setting.
SessionBeans be be both BMT or CMT. These settings depends on how atomic
the work they are performing are. For instance again, the Account bean has
two methods, withdrawl and deposit. Each action is atomic, so you could set
this up as Supports also, since if it were the root component, and someone
called withdrawl and that failed, there is little else needing to be rolled
back. But, you could choose to make it Requires, so that if the balance
were < 0, you would be able to force a rollback to occur. Now, the Teller
bean has one method transfer(). This method is far from atomic as a
transfer() is a withdrawl() and a deposit() i the same transaction.
Therefore I HAVE to make sure that work occurs in a transaction, and I could
choose either requires, or, requires new.
I would generally avoid BMT in a Stateful SB. Just my humble opinion.
But these decisions are based competely on your business rules, not the type
of component you are writing. The advantage of declarative tx's is you can
rescope a tx just from these properties if the business rules require it.
My sample from the presentation is all packaged up, and Ill post in the next
few days.
Dave Wolf
Internet Applications Division
Sybase
> -----Original Message-----
> From: A mailing list for Enterprise JavaBeans development
> [mailto:[EMAIL PROTECTED]]On Behalf Of Ritesh_Srivastava
> Sent: Wednesday, August 16, 2000 7:40 AM
> To: [EMAIL PROTECTED]
> Subject: Transaction for entity and Session Bean.
>
>
> What type of transcation should each of these sholud support and why ?
> entity Bean : Container Managed Transaction.
> Session Bean : either container or bean managed transaction.
> moreover what type of transaction is most suitable for Statefule and
> Stateless Session Beans.
>
> ==================================================================
> =========
> 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".
===========================================================================
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".