-
1. Re: Use Narayana JBoss with PostGreSQL
tomjenkinson Sep 18, 2018 6:30 AM (in response to syedatifhusain)Hi Atif,
Unless things changes it seems that PostgreSQL did not have a C API for transaction management: Re: XA Resource Survey
Has it changed at all?
Thanks,
Tom
-
2. Re: Use Narayana JBoss with PostGreSQL
mmusgrov Sep 18, 2018 6:59 AM (in response to tomjenkinson)There was a thread on the postgresql mailing list about the lack of XA support in the C API library (libpq). The conclusion of the thread is dangling which I guess implies that the support has not been added in the intervening years.
-
3. Re: Use Narayana JBoss with PostGreSQL
syedatifhusain Sep 18, 2018 9:20 AM (in response to tomjenkinson)I thought all Narayana APIs except BlackTie are all Java based and XA is performed by the Narayana APIs. So can't we use PG Java API for transaction management?
Can we use Blacktie for ATMI calls and use Java based Narayana APIs to connect to PostGres and leverage XA?
Regards,
Atif
-
4. Re: Use Narayana JBoss with PostGreSQL
tomjenkinson Sep 18, 2018 9:45 AM (in response to syedatifhusain)Narayana can certainly be used with PostgreSQL. I thought you wanted to use postgres in the BlackTie side.
Are you trying to span a transaction from a C XATMI application into the application server where an EJB or similar updates a Postgres entity?
-
5. Re: Use Narayana JBoss with PostGreSQL
syedatifhusain Sep 18, 2018 10:44 AM (in response to tomjenkinson)I have to use the atmi calls of blacktie. I will be using transaction related calls tpbegin and tpcommit of atmi. Will I be able to call these APIs and perform Postgres connectivity for this transaction via Narayana?
I am asking if I can use this as a workaround, since c API for Postgres is not there.
~atif
-
6. Re: Use Narayana JBoss with PostGreSQL
tomjenkinson Sep 19, 2018 4:50 AM (in response to syedatifhusain)Sorry, I am still not totally clear on the "mix-and-match".
If you are saying can you start a transaction using tx_begin [1] (this is the spec compliant version of tpbegin) then call a Java service [2] which uses postgres and this Java service is hosted on WildFly then that should work.Take a look at quickstart/blacktie/integration1 at master · jbosstm/quickstart · GitHub and see if it helps (the xatmi_adapter element of it seems to do (except the postgres side) what you are attempting. Using postgres from an EJB in WildFly should then work.
[1] narayana/tx.h at master · jbosstm/narayana · GitHub
[2] narayana/Service.java at 1e17caa16b5efb9b16cdb2d8489a1b93722ebdd5 · jbosstm/narayana · GitHub