dcsimg
Transaction Attribute problem
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   raja_raja
Posted On:   Tuesday, January 17, 2006 06:38 AM

NotSupported If the client is running within a transaction and invokes the enterprise bean's method, the container suspends the client's transaction before invoking the method. After the method has completed, the container resumes the client's transaction. If the client is not associated with a transaction, the container does not start a new transaction before running the method. Use the NotSupported attribute for methods that don't need transactions. Because transactions involve overhead, this attribute may improve performance. Hi, I am confused with the above definition. "client is running within a transaction" "container suspends the client's transaction   More>>


NotSupported

If the client is running within a transaction and invokes the enterprise bean's method, the container suspends the client's transaction before invoking the method. After the method has completed, the container resumes the client's transaction.
If the client is not associated with a transaction, the container does not start a new transaction before running the method.
Use the NotSupported attribute for methods that don't need transactions. Because transactions involve overhead, this attribute may improve performance.



Hi, I am confused with the above definition.



"client is running within a transaction"

"container suspends the client's transaction"

"container resumes the client's transaction."



If a client is running there will be only one transaction. The definition is really confusing me. Can any one help me out.


Thanks

Raja

   <<Less

Re: Transaction Attribute problem

Posted By:   Anonymous  
Posted On:   Tuesday, January 24, 2006 05:48 AM


In the definition, its talking about a method, say rajTrans() in a EJB, say RajEJB.

Anything that calls this RajEJB.rajTrans() is called a client.

1. This can be another EJB.

2. This can be a JavaBean.

3. This can be a UseBean.

4. This can be a servlet/jsp

5. This could be anything.

For instance assume that its another EJB, SatEJB. Now a method in this SatEJB, say satTrans(). This method has a transaction attribute as say Supports. Now this method is calling RajEJB.rajTrans().


Coming to your questions:

1. "client is running within a transaction"

SatEJB.satTrans() is calling RajEJB.rajTrans()
because some other code, say ABC.xyz() would have called SatEJB.satTrans(). This means client is already running within a transaction (Supports).



2. "container suspends the client's transaction"

When SatEJB.satTrans() calls RajEJB.rajTrans(), container sees that rajTrans() does NOT support transactions. So container suspends rajTrans()'s client's transaction. This means it suspends the transaction that was started when SatEJB.satTrans() was invoked.



3."container resumes the client's transaction."

After the execution of RajEJB.rajTrans() is complete, the trasaction of SatEJB.satTrans() which was suspended during the invocation of RajEJB.rajTrans() will be resumed.




Hope this clarifies your questions.

Bye

Satish

Re: Transaction Attribute problem

Posted By:   ankush_purwar  
Posted On:   Tuesday, January 17, 2006 02:52 PM

Are you talking about only J2EE transactions.
and what you mean by client.
Is it like this :
Two session beans
S1 (method m1) transaction required

and S2 (method m2) transaction Supports

Now web Client calls m1 of S1 which internally calls m2 of S2.

Now in this case there are two levels of indirection
(Web Client is client for S1
And S1 is client for S2)

So for which client you are talking.
About | Sitemap | Contact