This week's book giveaways are in the Cloud/Virtualization and Go forums.
We're giving away four copies each of Cloud Native Transformation: Practical Patterns for Innovation and The Go Workshop and have the authors on-line!
See this thread and this one for details.
Win a copy of Cloud Native Transformation: Practical Patterns for InnovationE this week in the Cloud/Virtualization forum
or The Go Workshop in the Go forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Joe Ess
  • salvin francis

Question about JDBC/DATASOURCE/TXDATASOURCE

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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
  • 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
 
It's a pleasure to see superheros taking such an interest in science. And this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!