• 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
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Database Updates/Inserts using SLSBs

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 41967
911
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Drove my Chevy to the levee but the levee was dry. A wrung this tiny ad and it was still dry.
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic