Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is Type 4 XA driver?

Tags:

java

jdbc

db2

In our application when we create the Datasource, we select the
Database Name DB2
Driver: BEA Type 4 XA DB2
But what i know is, there are only 4 types of Driver. Then what is Type 4 XA driver?

like image 558
Rakesh Juyal Avatar asked Nov 03 '09 17:11

Rakesh Juyal


3 Answers

From this blog entry.

An XA transaction, in the most general terms, is a "global transaction" that may span multiple resources.

That is, a transaction running across (say) 2 databases. So, for example, insertions can be managed across those 2 databases and committed/rolled back atomically.

The "type 4" refers to a native Java JDBC driver converting directly into the database protocol. See here for more details

like image 157
Brian Agnew Avatar answered Dec 01 '22 16:12

Brian Agnew


  • Type 4: All Native Java

  • XA: stands for Extensible Architecture which is refered mostly for a 2-phase-commit protocol - see wikipedia. Short: A standard protocol for a global transaction between one transaction coordinator and several transaction managers. Sometimes they are also called transaction monitors. It's pretty slow so should avoid it if you don't really need it. But well, at our customer we mostly need it :(

like image 41
dz. Avatar answered Dec 01 '22 16:12

dz.


Major advantage of XA is that it can access multiple databases in one connection/transaction.

like image 37
BalusC Avatar answered Dec 01 '22 15:12

BalusC