how EJB transaction attributes work

can anybody explain or provide some links how EJB transaction attributes work by giving some examples.i  understand theoritically but until and unless if i dont implement the examples with each attribute and i cannot get the grip on these attriibutes.
LVL 20
chaitu chaituAsked:
Who is Participating?
 
mukundha_expertCommented:
your understanding is correct,
in case of NOT SUPPORTED,
if client has already started a transaction (T1) and calls bean method (methodB) m then Transaction T1 is suspended an methodB is executed without any transaction context. Once methodB completes, T1 is resumed.

you need to use this attribute if your business method cannot support transaction (rollback or commit) - basically when you cannot get things undone means you cannot support transaction.

here you can find list of usecases for different transaciton attributes,
http://java.sun.com/blueprints/qanda/transaction_management/index.html#attributes
0
 
chaitu chaituAuthor Commented:
i have already seen this link by doing google search.any more links with examples.in the above link they have explained only theoritically.
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

 
chaitu chaituAuthor Commented:
I HAVE SEEN these links i want some working examples
0
 
chaitu chaituAuthor Commented:
In the above link also only explains theoritically.
0
 
chaitu chaituAuthor Commented:
all,

here is my understanding on transaction attributes.Please check and confirm.
Please find the attached excel file.

mukundha provided one article in that what is meant by 'Client's transaction.'

what i understood was methodA of bean1 class has started transaction with some transaction attribute.

transattribute.xls
0
 
mukundha_expertCommented:
chaituu,

looks good.
but remember that client can be anything - a servlet , ejb or any java class

also,
in case of Requires New & Not Supported -> The bean suspends the client's transaction (if any) and starts a new transaction. Once the Bean method ( new transaction) is completed, the client's transaction is resumed.

0
 
mukundha_expertCommented:
a Client is whoever is invoking the business method of the bean -
so a client transaction is the transaction initiated by the client.
0
 
chaitu chaituAuthor Commented:
In Not Supported  case if you see the table

NONE-if client is not started a transaction  then bean method(methodB) also does not start any new transaction.
T1-if client is started a transaction  then also bean method(methodB)  will not participate in that transaction and not only that it does not create any new transaction.


If my understanding is correct then in which case we need to use this attribute?
0
 
chaitu chaituAuthor Commented:
thans you very much mukund.you cleared my doubts.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.