This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Difference between JDBC based transaction and the Java Transaction API  RSS feed

 
Greenhorn
Posts: 9
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am just beginning to work on a  JAVA based project under which I have an option to use either a JDBC based transaction or the Java Transaction API? Now, I am not much aware of both of them, but I went through few posts online. However, I couldn't really understand when to use which one? How do we differentiate what would suit our need under which scenario?
 
Marshal
Posts: 60083
188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let's move you to our databases forum.

Don't know about the transaction API, but I know that transactions aren't part of JDBC; they are part of the database program. The database can run a transaction for you and you use JDBC to request a transaction. A transaction in a database runs to completion before anything else is committed to memory. During a transaction no other code may access the information used in that transaction. I would think you are better off looking for an SQL/databases tutorial and looking for its section about transactions (or you may have a book about databases, or lecture notes about databases). I would take it for granted that the tutorial/lecture/book would explain what ACID means. I think a tutorial/book/lecture would be better than finding a post.
 
Saloon Keeper
Posts: 4744
117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The main difference between JDBC transactions and the JTA is that JTA supports transactions across DBs, something that is beyond JDBC. So unless you need to synchronize two or more DBs, I suggest to stick to JDBC transactions.

Campbell Ritchie wrote:A transaction in a database runs to completion before anything else is committed to memory. During a transaction no other code may access the information used in that transaction.


That depends on the transaction isolation level used by the DB, a concept that is supported by the JDBC (although not all DBs supports all the levels than JDBC does).
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!