• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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: 41860
908
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.
 
We find this kind of rampant individuality very disturbing. But not this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic