aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Transaction Context Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Transaction Context" Watch "Transaction Context" New topic
Author

Transaction Context

Balaji Anand
Ranch Hand

Joined: Nov 03, 2004
Posts: 146
hi
I am too confused abt what methods run in
Callers Transaction context
Unspecified transaction context
and no transaction context

Can someone help me by listing them ?
Thanks for your help in advance
MI Mohammed
Ranch Hand

Joined: Feb 16, 2005
Posts: 146
Originally posted by Anand

I am too confused abt what methods run in
Callers Transaction context
Unspecified transaction context
and no transaction context

Hi Anand,
Let's break your question down, to get a clear picture of the situation.
First a transaction is unit of say work, either all successed or all fails. The same is true, if any of the work fails. There isn't 30%,80% or 99%, like
we do get from all this exams. It is either you get 100% 0r you go back and pay more bucks to those guys at Sun. So hope you got that.There is <tran-attribute> used to specify transaction type in the DD (only for CMT).

Unspecified transaction context: This is a bit complex, even the spec say so, it simply mean the container can handle the transaction, in an undefined
manner. To you, it's like i don't know, but the container can choose to
handle it whichever it chooses. Ok let's hit some examples.
Let's use three methods, say A,B,C.

For BMT.

methodA() { // this is the caller method.
tx = context.getUserTransaction();
tx.begin(); // transaction starts
methodB(); // Called method it's part of the transaction
tx.commit(); // transaction commit ie end
methodC(); // methodC is called without transaction context
// not part of the transaction
For CMT, it's on method bases depending on the attriute in the DD.
Wao, hope it's help


SCJA(Beta) SCJP 1.4 SCWCD 1.4 SCBCD 1.3 SCBCD 5.0 beta <br />The more practice we get, the better we are at the exams and in life in general. Pls join me at My DEN.
MI Mohammed
Ranch Hand

Joined: Feb 16, 2005
Posts: 146
Originally posted by Anand

I am too confused abt what methods run in
Callers Transaction context
Unspecified transaction context
and no transaction context

Hi Anand,
Let's break your question down, to get a clear picture of the situation.
First a transaction is unit of say work, either all successed or all fails. The same is true, if any of the work fails. There isn't 30%,80% or 99%, like
we do get from all this exams. It is either you get 100% 0r you go back and pay more bucks to those guys at Sun. So hope you got that.There is <tran-attribute> used to specify transaction type in the DD (only for CMT).

Unspecified transaction context: This is a bit complex, even the spec say so, it simply mean the container can handle the transaction, in an undefined
manner. To you, it's like i don't know, but the container can choose to
handle it whichever it chooses. Ok let's hit some examples.
Let's use three methods, say A,B,C.

For BMT.

methodA() { // this is the caller method.
tx = context.getUserTransaction();
tx.begin(); // transaction starts
methodB(); // Called method it's part of the transaction
tx.commit(); // transaction commit ie end
methodC(); // methodC is called without transaction context
// not part of the transaction
For CMT, it's on method bases depending on the attriute in the DD.
Wao, hope it helped
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Transaction Context