• Post Reply Bookmark Topic Watch Topic
  • New Topic

Hibernate Transaction

 
Pho Tek
Ranch Hand
Posts: 782
Chrome Python Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The transaction strategy configuration can take one of two things:
  • JTATransaction
  • JDBCTransaction

  • What are the differences between JTA and JDBC transactions ?

    Here's what I think (correct me please). JDBC transactions are managed by the JDBC driver itself. i.e. the jdbc driver IS the tx manager and resource manager. Thus it doesn't support 2PC.

    Whereas JTA transaction supports 2PC.

    What do you think ?

    Regards,

    Pho
     
    Mircea Crisan
    Greenhorn
    Posts: 1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hi,
    JDBC transaction: one connection with commit()/rolback().
    JTA transaction: one or more (XA) resources with start(), prepare(), commit()/rollback(). This is used for distributed transactions with 2 phase commit protocol. However, if only one resource is involved, a smart transaction manager should optimize the 2 phase commit into one phase commit by skiping the prepare() and calling commit(xid, true).
    Best regards, Mircea
     
    Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
    the new thread boost feature: great for the advertiser and smooth for the coderanch user
    https://coderanch.com/t/674455/Thread-Boost-feature
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!