my dog learned polymorphism*
The moose likes EJB and other Java EE Technologies and the fly likes The very existance of Transaction Handling Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "The very existance of Transaction Handling" Watch "The very existance of Transaction Handling" New topic
Author

The very existance of Transaction Handling

Rohit Ahuja
Ranch Hand

Joined: Oct 04, 2001
Posts: 121
Well,
I have read a lot about transaction handling when it comes to EJBs.
My Question is , i can write a simple program wherein i set the autocommit feature to false, perform operations on the different tables and finally commit it.
in case of any failure,anyways oracle will deal with the problem.
even as far as concurrency goes,oracle is cpable of dealing with the problem.
So whats so special with EJBs.


Face Off.
Irene Loos
Ranch Hand

Joined: Apr 15, 2002
Posts: 78
EJBs are implementation independent and designed to manage distributed business objects in tree-tier architecture.


Irene Loos
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16019
    
  20

While Oracle may manage transactional integrity within the context of the DBMS, EJB transactions (and J2EE transactions in general) offer a broader scope in that they can manage items above and beyond the DBMS, such as servers, flat files, and other non-DBMS resources.


Customer surveys are for companies who didn't pay proper attention to begin with.
Rohit Ahuja
Ranch Hand

Joined: Oct 04, 2001
Posts: 121
Tim please be a little more specific.
i aint getting thee.
Rohit Ahuja
Ranch Hand

Joined: Oct 04, 2001
Posts: 121
Tim i wud be thankful if u add me in ur friend list on yahoo or msn messenger.
My adds are reebok_78@yahoo.com
and dreamy_piscean@hotmail.com.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16019
    
  20

Sorry, I'm not presently set up for IM. However, perhaps I can illustrate.
Let's say you work for a big software house in Chennai. They pay you a fixed rate for every EJB you code (Rs. 5,000,000 per EJB is the going rate, right?). You telecommute from your penthouse suite with the spectacular ocean view and you have automated the process of turning over finished EJBs in a way that ensures you get paid. This is done by sending the EJB as an encrypted file and only sending the key after you have confirmed payment.
Here's the transaction sequence:
1. Start transaction context
2. FTP the EJB to your employer. They employer returns a code that activates transfer of money to your bank account.
3. Contact the Bank of India and provide them with your funds transfer code.
IF the BOI server is down, OR they refuse to honor
the funds transfer, or for some other reason, you don't get confirmation...
THEN rollback the transaction. I.e. erase the encrypted EJB from your employer's server or simply refuest to submit the key.
4. OTHERWISE, send the key that unlocks your EJB
5. END transaction
I know this is a little contrived, but maybe it shows why database transaction manangement isn't always sufficient. After all, I hardly think that the Bank Of India is going to let you directly lock records in their DBMS (besides, they might not have Oracle, they might have DB2!).
Rohit Ahuja
Ranch Hand

Joined: Oct 04, 2001
Posts: 121
Thanx Tim,
I Got it much better this time. But whenever u have an msn or yahoo messenger on u have to add me as a friend.
After all, i like the intelligent species to be on my friend list u see.
Thanx Again.
Rohit Ahuja
Ranch Hand

Joined: Oct 04, 2001
Posts: 121
By the Way, tim,
5 lakhs for an ejb i guess is a bit too much.

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16019
    
  20

Originally posted by Deepak a:
By the Way, tim,
5 lakhs for an ejb i guess is a bit too much.


Oh surely not. Larry Ellison wouldn't be hiring 2000 programmers in Bangalore just because you work cheap now?
Sorry. The recession is still in full swing over here
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: The very existance of Transaction Handling