2

I have a software project running in IBM Websphere 8.5.5. It needs to lookup the JTA TransactionManager from the application server. Currently it uses the com.ibm.ws.Transaction.TransactionManagerFactory class, and then calls getTransactionManager() on that.

My question is this: Is it legitimate to do this in IBM Websphere 8.5? It seems there are newer interfaces around (e.g. UOWManager). However, I haven't been able to find any documentation on the use of com.ibm.ws.Transaction.TransactionManagerFactory beyond Websphere 5. It doesn't say anywhere that it can be used. It doesn't say anywhere that it shouldn't be used either.

So does com.ibm.ws.Transaction.TransactionManagerFactory still work, albeit old-fashioned? Or is it problematic and shouldn't be used?

(I haven't seen the code fail so far, but this might mean either a) it works properly, or b) we just haven't hit the right test cases!)

ᄂ ᄀ
  • 5,669
  • 6
  • 43
  • 57

1 Answers1

4

com.ibm.ws.Transaction.TransactionManagerFactory is considered a product internal and is therefore not supported by application use (that is why it isn't documented). The UOWManager is supported and should support the key use cases people ask for TransactionManager access for. Without knowing what the use case is I can't provide better advice.

Alasdair
  • 3,071
  • 15
  • 20
  • We had the same problem when we tried to use Hibernate + Infinispan 2nd level cache on WebSphere. In some scenaria, Infinispan wanted to suspend the transaction, do its own work and then resume. The only `javax.transaction.TransactionManager` we could hook into (with direct suspend / resume APIs) was the one returned by `com.ibm.ws.Transaction.TransactionManagerFactory`. How can suspend / resume be done with WebSphere's supported APIs? – Kos Prov May 12 '16 at 16:12
  • 1
    @KosProv Arbitrary suspend/resume cannot be done. You can use `UOWManager.runUnderUOW`, which will do the suspend/resume on your behalf in a controlled fashion. Effectively, the product does not want to allow that application code will fail to resume the transaction or will attempt to resume the transaction in a different EE "scope" (e.g., suspend within an EJB call and resume after returning, or resume the transaction in another thread). – Brett Kail May 12 '16 at 19:55
  • @Alasdair Thank you for your reply. I didn't want to complicate the question by being more specific about the use case, as the details are not important. I was checking what my options are, since switching to `UOWManager` is non-trivial. (Especially since parts of the code are beyond my control, i.e. in library .jars.) – Dimitris Routsis May 16 '16 at 11:00