• 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Database Updates/Inserts using SLSBs

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
From a Design Perspective,is it OK to do database updates/deletes using SLSBs and JDBC?If yes is JDBC good enough to handle transactions.Or do I need to use
the JTA API?

Thanks
Mike
 
author & internet detective
Posts: 40036
809
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mike,
Welcome to JavaRanch!

From a design perspective using JDBC and SLSBs is fine. You can set the SLSB with a transaction setting to manage the transaction for you (rather than use JTA.) And if each statement is a transaction in itself, you don't even need to do that - JDBC handles it for you.
 
Mike Robinson
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot for your swift reply.So this mean that the commit and the rollback will be handled by the container itself.Thats great.

Thanks a lot again

Krishnan
 
Mike Robinson
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot for your swift reply.So this mean that the commit and the rollback will be handled by the container itself.Thats great.

Thanks a lot again
 
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For a non-EJB application, you have the option of JDBC or JTA transactions. But for an EJB application, the container uses JTA transactions under the covers for CMT beans. Of course, you explicitly use JTA for BMT beans. The container will handle all commits and rollbacks.
 
Live a little! The night is young! And we have umbrellas in our drinks! This umbrella has a tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic