[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.
Technical Discussion :: WebMethod

51 / 166

Type of transaction? Local ,XA,No transaction Explain?

Answer:

1. NO_TXN: When you configure any JDBC Connection with NO_TXN as TXN type, the Adapter Services which use this kind of connection need not be used commit and rollback services explicitly by the developer. Which means all the transactions are auto commit or auto roll back.

2. LOCAL_TXN: For Adapter Services which use any connection that was configured with LOCAL_TXN as TXN Type, then the developer has to use the pub.art.transaction.commit & pub.art.transaction.rollback explicitly in his code; which means the transactions are not auto committed and needs explicit transaction control.
Also, all the DB Interactions within the transaction boundary are committed or rolled back together. Txn boundary is when you start a TXN using pub.art.startTransaction ; You can write as many Adapter Services as you want here and then endTransaction;as you are using LOCAL_TXN all these adapter Services will be committed or rolled back together.

Note: in LOCAL_TXN the entire adapter Services you write between start and end txns should be talking to same database (can talk to multiple tables, though)


3. XA_TXN: Same as Local txn; but the adapter services you write in between start and end can talk to Different Databases; which means XA_TXN supports multiphase transactions. A transaction will be used when you want to say, insert content into 2 Diff DBs, one after the other; If the insert in 2nd DB fails then if you want to rollback in the 1st DB as well, then use XA txn.
No transaction -- means the DB manages the transaction (not IS); this is "auto-commit"
Local transaction -- means IS manages the transaction; can only involve one Local transaction connection and 0 or more "No transaction" connections
XA transaction -- means IS manages the transaction and can handle distributed transactions (operation over more than 1 database)
Local transaction means in a single transaction we can do multiple operations on a single database. To be more clear all these multiple operations use the same Adapter connection.
XA transaction means in a single transaction we can do multiple operations on different databases.
To be more clear all these multiple operations use different Adapter connection.
Use no transaction for select and local transaction for any DML (insert, delete, and update) operations to handle the transaction boundary (via start, commit and rollback).

Asked In ::

Post Your Answer Here:


Rate This: +7 -0      +2
Report    

Post Your Reply Here:

Alert me
q4i-reply-your-answer

Report Error

Please Login First Click Here

Rate This: +1 -0      +
Report    

Post Your Reply Here:

Alert me
q4i-reply-your-answer

Report Error

Please Login First Click Here

Most Popular Qs.