Narayana Transaction Manager support Non XA

721 views
Skip to first unread message

diptim...@verizon.com

unread,
Feb 8, 2018, 4:44:35 PM2/8/18
to jBPM Usage
Hi,


MariaDB Galera Cluster that doesn't support XA. Would Narayana Transaction Manager support Non XA Support, if yes, please provide some intructions/guidelines for setup?

Thanks,
-Diptiman

Peter Jerald

unread,
Feb 8, 2018, 11:23:10 PM2/8/18
to jBPM Usage
Good question !

To implement NTM with non-XA we need to implement with LRCO.  In bitronics we have "bitronix.tm.resource.jdbc.lrc.LrcXADataSource" class to handle non-xa. Similarly  nayana (or) kie-engine has any LRCO class? 

Maciej Swiderski

unread,
Feb 9, 2018, 3:44:42 AM2/9/18
to Peter Jerald, jBPM Usage
best to look up in narayana documentation, a quick google search found this https://developer.jboss.org/thread/269002 which seems to indicate it should be possible

Maciej

--
You received this message because you are subscribed to the Google Groups "jBPM Usage" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbpm-usage+...@googlegroups.com.
To post to this group, send email to jbpm-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jbpm-usage/cc535986-ead3-4018-b5c8-acdd353b2811%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Peter Jerald

unread,
Feb 9, 2018, 4:27:10 AM2/9/18
to jBPM Usage
Thanks. Let me check given link. Do we have guidelines (or) documentation to integrate narayana + jbpm ?

Maciej Swiderski

unread,
Feb 9, 2018, 8:18:55 AM2/9/18
to Peter Jerald, jBPM Usage
it really depends on the runtime setup - there is not much need to configure from jbpm side - the only thing it cares about is to be able to fine user transaction, transaction manager and transaction sync registry in JNDI - so that is the only thing you need to do - bind narayana objects into JNDI. This though depends on runtime environment to know how to bind it

Maciej

> On 9 Feb 2018, at 10:27, Peter Jerald <peter.a...@gmail.com> wrote:
>
> Thanks. Let me check given link. Do we have guidelines (or) documentation to integrate narayana + jbpm ?
>
> --
> You received this message because you are subscribed to the Google Groups "jBPM Usage" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to jbpm-usage+...@googlegroups.com.
> To post to this group, send email to jbpm-...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/jbpm-usage/5973e4c3-5ecc-4a9f-8e4e-97af588c2528%40googlegroups.com.

Peter Jerald

unread,
Feb 14, 2018, 11:03:28 PM2/14/18
to jBPM Usage
Thank you so much !

As you said "jbpm" only cares on three factors on JNDI. To bind narayana objects into JNDI I created a transaction manager config class & Data configuration class with Transcational support. 

During startup transaction manager was configured properly and Kie-engine started with non-XA. Here is sample log;

2018-02-15 08:56:17.801 TRACE 272 --- [           main] com.arjuna.ats.arjuna                    : BasicAction::onePhaseCommit() for action-id 0:ffffc0a83801:f7ed:5a84fdd8:2
2018-02-15 08:56:17.803 TRACE 272 --- [           main] com.arjuna.ats.jta                       : XAResourceRecord.topLevelOnePhaseCommit for XAResourceRecord < resource:org.apache.commons.dbcp2.managed.LocalXAConnectionFactory$LocalXAResource@261275ae, txid:< formatId=131077, gtrid_length=41, bqual_length=36, tx_uid=0:ffffc0a83801:f7ed:5a84fdd8:2, node_name=kie-server-tx, branch_uid=0:ffffc0a83801:f7ed:5a84fdd8:5, subordinatenodename=null, eis_name=0 >, heuristic: TwoPhaseOutcome.FINISH_OK com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord@77c692b4 >, record id=0:ffffc0a83801:f7ed:5a84fdd8:6

Full Log :- https://raw.githubusercontent.com/PeterJerald/kie-server-narayana-non-xa/master/kie-server-spring-boot-sample/log_h2.log

I am able to deploy a Kjar & start business process via non-xa but once transactions are finished hibernate layer trying to release connection but at one case before releasing the connection . It was closed . Hence I am getting null pointer exception like below trace but after that i am seeing successful transaction executed . I tried multiple workaround but didn't work. Can you please tell me how to fix this issue ?

code :- https://github.com/PeterJerald/kie-server-narayana-non-xa

2018-02-15 08:57:39.055  WARN 272 --- [0.1-8090-exec-4] com.arjuna.ats.jta                       : ARJUNA016029: SynchronizationImple.afterCompletion - failed for org.hibernate.resource.transaction.backend.jta.internal.synchronization.RegisteredSynchronization@39e6ca57 with exception

java.lang.NullPointerException: null
	at org.apache.commons.dbcp2.DelegatingConnection.isClosed(DelegatingConnection.java:597) ~[commons-dbcp2-2.1.1.jar:2.1.1]
	at org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.releaseConnection(LogicalConnectionManagedImpl.java:166) ~[hibernate-core-5.1.10.Final.jar:5.1.10.Final]

Peter Jerald

unread,
Feb 16, 2018, 11:30:53 AM2/16/18
to jBPM Usage
On Thursday, 15 February 2018 09:33:28 UTC+5:30, Peter Jerald wrote:
> Thank you so much !
>
>
> As you said "jbpm" only cares on three factors on JNDI. To bind narayana objects into JNDI I created a transaction manager config class & Data configuration class with Transcational support. 
>
>
> During startup transaction manager was configured properly and Kie-engine started with non-XA. Here is sample log;
>
>
> 2018-02-15 08:56:17.801 TRACE 272 --- [ main] com.arjuna.ats.arjuna : BasicAction::onePhaseCommit() for action-id 0:ffffc0a83801:f7ed:5a84fdd8:2
> 2018-02-15 08:56:17.803 TRACE 272 --- [ main] com.arjuna.ats.jta : XAResourceRecord.topLevelOnePhaseCommit for XAResourceRecord < resource:org.apache.commons.dbcp2.managed.LocalXAConnectionFactory$LocalXAResource@261275ae, txid:< formatId=131077, gtrid_length=41, bqual_length=36, tx_uid=0:ffffc0a83801:f7ed:5a84fdd8:2, node_name=kie-server-tx, branch_uid=0:ffffc0a83801:f7ed:5a84fdd8:5, subordinatenodename=null, eis_name=0 >, heuristic: TwoPhaseOutcome.FINISH_OK com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord@77c692b4 >, record id=0:ffffc0a83801:f7ed:5a84fdd8:6Full Log :- https://raw.githubusercontent.com/PeterJerald/kie-server-narayana-non-xa/master/kie-server-spring-boot-sample/log_h2.log
> I am able to deploy a Kjar & start business process via non-xa but once transactions are finished hibernate layer trying to release connection but at one case before releasing the connection . It was closed . Hence I am getting null pointer exception like below trace but after that i am seeing successful transaction executed . I tried multiple workaround but didn't work. Can you please tell me how to fix this issue ?code :- https://github.com/PeterJerald/kie-server-narayana-non-xa2018-02-15 08:57:39.055 WARN 272 --- [0.1-8090-exec-4] com.arjuna.ats.jta : ARJUNA016029: SynchronizationImple.afterCompletion - failed for org.hibernate.resource.transaction.backend.jta.internal.synchronization.RegisteredSynchronization@39e6ca57 with exception
>
> java.lang.NullPointerException: null
> at org.apache.commons.dbcp2.DelegatingConnection.isClosed(DelegatingConnection.java:597) ~[commons-dbcp2-2.1.1.jar:2.1.1]
> at org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.releaseConnection(LogicalConnectionManagedImpl.java:166) ~[hibernate-core-5.1.10.Final.jar:5.1.10.Final]
> On Friday, 9 February 2018 18:48:55 UTC+5:30, Maciej Swiderski wrote:it really depends on the runtime setup - there is not much need to configure from jbpm side - the only thing it cares about is to be able to fine user transaction, transaction manager and transaction sync registry in JNDI - so that is the only thing you need to do - bind narayana objects into JNDI. This though depends on runtime environment to know how to bind it
>
>
>
> Maciej
>
>
>
> > On 9 Feb 2018, at 10:27, Peter Jerald <peter.a...@gmail.com> wrote:
>
> >
>
> > Thanks. Let me check given link. Do we have guidelines (or) documentation to integrate narayana + jbpm ?
>
> >
>
> > --
>
> > You received this message because you are subscribed to the Google Groups "jBPM Usage" group.
>
> > To unsubscribe from this group and stop receiving emails from it, send an email to jbpm-usage+...@googlegroups.com.
>
> > To post to this group, send email to jbpm-...@googlegroups.com.
>
> > To view this discussion on the web visit https://groups.google.com/d/msgid/jbpm-usage/5973e4c3-5ecc-4a9f-8e4e-97af588c2528%40googlegroups.com.
>
> > For more options, visit https://groups.google.com/d/optout.

Any inputs on this issue ?

Maciej Swiderski

unread,
Feb 19, 2018, 4:26:04 AM2/19/18
to Peter Jerald, jBPM Usage
I just tried your sample and it works as expected, I was able to deploy container and run number of process instances without any issue. Make sure you have narayana version 5.6.4 or newer

Maciej
> To view this discussion on the web visit https://groups.google.com/d/msgid/jbpm-usage/d9009398-5580-4d06-8729-55c79d8bd567%40googlegroups.com.

Peter Jerald

unread,
Feb 19, 2018, 5:05:04 AM2/19/18
to jBPM Usage
The problem lies on hibernate connection release process. Physical connection is getting closed but narayana sessions are not getting refreshed.

Hibernate attempts to aggressively releases connections , so I made flip in release mode from after_transcation to on_close .

If you refer application.properties I updated release mode. Its working for SINGLETON runtimestragey but if I change to PER_PROCESS_INSTANCE for BPM project same issue occurring again .

Maciej Swiderski

unread,
Feb 19, 2018, 6:12:33 AM2/19/18
to Peter Jerald, jBPM Usage
the root cause is use of commons-dbcp that has severe issues when running with narayana so I’d recommend to move to tomcat-dbcp and tomcat-jdbc which proved to be working well

btw, what’s the point of this work? if you have single resource for narayana then it will optimise to work in kind of nonXA way ….

Maciej
> --
> You received this message because you are subscribed to the Google Groups "jBPM Usage" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to jbpm-usage+...@googlegroups.com.
> To post to this group, send email to jbpm-...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/jbpm-usage/13cbd7c2-8f1c-4513-ac10-ebaf804aaead%40googlegroups.com.

Peter Jerald

unread,
Feb 19, 2018, 8:08:46 AM2/19/18
to jBPM Usage
"btw, what’s the point of this work? if you have single resource for narayana then it will optimise to work in kind of nonXA way …. "

Making Kie-server to work with non-xa environment like mariadb with Galera replication. Galera replication does not allow XA transaction.

Tomcat dpcp type classes such as DataSource & XADataSource don't have LocalXAConectionFactory which provides proxy layer for one-phase commit.

Please let me know if you have any other steps.





Reply all
Reply to author
Forward
0 new messages