• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

Question about JDBC/DATASOURCE/TXDATASOURCE

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello, everyone:
I have a couple of questions for you. What is the advantage of datasource over JDBC? What is the difference between datasource and txdatasource?
Thank you very much and have a nice weekend.
Jason
 
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A Datasource hands out JDBC connections and in WebLogic it is backed by a Connection Pool. This the preferred method of retrieving JDBC connections in J2EE since it makes code easier to move between Application Servers (ie. all app servers support datasources).
A TXDatasource can be involved in a distributed transaction, a regular Datasource cannot. If you are using container managed transactions or JTA then you must use a TXDatasource.
 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Chris Mathews:
A Datasource hands out JDBC connections and in WebLogic it is backed by a Connection Pool. This the preferred method of retrieving JDBC connections in J2EE since it makes code easier to move between Application Servers (ie. all app servers support datasources).
A TXDatasource can be involved in a distributed transaction, a regular Datasource cannot. If you are using container managed transactions or JTA then you must use a TXDatasource.


Hi,
Where can I find more information about the difference between TXDatasource and Regular Datasource? Why does Weblogic provide two different types of datasource? My understanding is the Regular Datasource is the subset of TXDatasource, so there's no need to provide the Regular Datasource. As I know, Websphere only proved one type of Datasource which provide transcation support.
Any comments,
Tom
 
Chris Mathews
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Take a look at this document: JDBC Configuration Guidelines for Connection Pools, MultiPools and DataSources.
 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
The advantage of DataSource over DriverManager interface is that DataSource is JNDI compatible. We can do a lookup on JNDI to obtain a handle of DataSource the same is not possible using Driver Manager interface.
Transactional DataSources are generally used in scenarios wheteher you turn off the auto commit option to control the transaction. This feature is also used in cases involving 2 phase commit.
Reagrds,
Milind
 
Yup, yup, yup. Tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic