• 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

legacy app and hibernate app

 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We have a web service we are implementing that is going to have to participate in global transactions with the client. For our Hibernate/Spring apps where we use @Transactional, this is not a problem. However, we have at least two legacy applications using bare bones JDBC. They are large enough that retrofitting is not viable in the near term, yet they must talk to this web service and participate in the two-phase commit.

We were hoping we could distribute a jar with the web service client in it that would expose a method that would take the JDBC connection, hook it into an @Transactional boundary, do some work, including calling the web service, and be able to have it use the connection provided from the legacy app. In other words, we need a way to hand a particular connection, upon which a transaction has already started, to the @Transactional instead of the one it would naturally allocate. And obviously it could not commit when it leaves since the legacy app does the commiting.

Does anyone have the faintest idea of how to pull this off?
 
Brian Mulholland
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I gather that TransactionAwareDataSourceProxy seems to be intended for this use, but I see no examples. I just see people saying that this (integrating legacy JDBC and JTA) is what it is for.

It feels like I should somehow start the JTA transaction outside the method and not use the annotation. If the connection is in the session, bound to the thread and transactions started, then everything should pick up automagically right? But if so, I am not sure how to do that.
reply
    Bookmark Topic Watch Topic
  • New Topic