No, only the execute method will have a transaction,
but since it calls all the other methods, they will
run in that same transaction as well.

Frank

> -----Original Message-----
> From: A mailing list for Enterprise JavaBeans development
> [mailto:[EMAIL PROTECTED]]On Behalf Of Poh Kheng Thong
> Sent: Thursday, May 18, 2000 10:15 PM
> To: [EMAIL PROTECTED]
> Subject: Doubts about using reflection API within Session bean and
> Transaction support.
>
>
> Hi all,
>
> I have the following doubts regarding the use of reflection API to
> locate business methods within a Session bean, and to invoke the
> method.
>
> // Remote Interface
> public interface MyBean extends EJBObject {
> public void execute (String sMethodName, Vector vParam) throws
> RemoteException;
> }
>
> // Implementation class
> public class MyBeanEJB implements SessionBean {
> // Stateless Session Bean
> public void execute (String sMethodName, Vector vParam) {
> Class oClass = this.getClass ();
> Class [] aParamTypes = {Vector.class};
> Method oMethod = oClass.getMethod (sMethodName, aParamTypes);
> Object [] aParamValues = {vParam};
> oMethod.invoke (this, aParamValues);
> }
>
> public void BisMethodA (Vector aParamValues) {
> // execute business logic A
> }
>
> public void BisMethodB (Vector aParamValues) {
> // execute business logic B
> }
> }
>
> The above bean works just fine in my machine. However,
> I have one question regarding transaction support provided by EJB
> container. When invoking business method (i.e. BisMethodA etc) this
> way, will the EJB container still be able to handle transaction
> correctly for me. Since this is a Stateless session bean and I have
> set the tx_attribute to TX_Required, I would want every method
> invocation to be within a proper transaction context. Please take
> notes that all my business methods are not declared in my bean's
> remote interface, instead only the "execute" method is included in the
> remote interface. Will EJB server add necessary transaction support
> for these methods though they are not defined in the remote interface.
>
> Thanks & regards,
> KT
>
> ==============================================================
> =============
> 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