ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum IndexWebSphere Message Broker SupportJDBC connection in message broker

Post new topicReply to topic
JDBC connection in message broker View previous topic :: View next topic
Author Message
gappodi
PostPosted: Wed Nov 29, 2017 7:05 am Post subject: JDBC connection in message broker Reply with quote

Apprentice

Joined: 05 Sep 2014
Posts: 43

I was going through the following documentation in order to understand JDBC connections are obtained in broker by JCN.

https://www.ibm.com/support/knowledgecenter/en/SSMKHH_9.0.0/com.ibm.etools.mft.doc/ac30494_.htm

I have two questions here....

1) Does message broker API mandate that a call to getJDBCType4Connection() method MUST be made with in evaluate() or onitialize() method of a JCN ?

2) Is there a harm if a call to getJDBCType4Connection() method is made from a user defined method in a JCN.

The reason I am asking this is because I saw following exception in my application when run in a multi-threaded mode and having a call to getJDBCType4Connection() method in a user defined method in one of the JCNs.

at com.ibm.broker.jdbctype4.localtrxn.JDBCType4SinglePhaseTrxnHandlerErrors.throwException(JDBCType4SinglePhaseTrxnHandlerErrors.java:217)
at com.ibm.broker.jdbctype4.localtrxn.JDBCType4SinglePhaseTrxnHandler.getConnection(JDBCType4SinglePhaseTrxnHandler.java:338)
at com.ibm.broker.jdbctype4.localtrxn.JDBCType4SinglePhaseTrxnHandler.getConnection(JDBCType4SinglePhaseTrxnHandler.java:154)
at com.ibm.broker.jdbctype4.connfact.JDBCType4ConnectionFactory.getConnection(JDBCType4ConnectionFactory.java:163)
at sun.reflect.GeneratedMethodAccessor37.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:56)
at java.lang.reflect.Method.invoke(Method.java:620)
at com.ibm.broker.plugin.MbNode.getJDBCType4Connection(MbNode.java:1564)
at com.ibm.einvoicing.java.common.hrpdf.GenerateHRPdf.findAndLoadXSLTIS(GenerateHRPdf.java:305)
at com.ibm.einvoicing.java.common.hrpdf.GenerateHRPdf.evaluate(GenerateHRPdf.java:140)
at com.ibm.broker.javacompute.MbRuntimeJavaComputeNode.evaluate(MbRuntimeJavaComputeNode.java:281)
at com.ibm.broker.plugin.MbNode.evaluate(MbNode.java:1480)
at com.ibm.broker.plugin.MbOutputTerminal._propagate(Native Method)
at com.ibm.broker.plugin.MbOutputTerminal.propagate(MbOutputTerminal.java:133)
at com.ibm.broker.plugin.MbOutputTerminal.propagate(MbOutputTerminal.java:88 )


I do not see this exception when run in multi threaded mode and having a call to getJDBCType4Connection() method inside evaluate() method in one of the JCNs.


Please provide thoughts here..

Regards,
Maneesh Sharma
Back to top
View user's profile Send private message
martinb
PostPosted: Thu Nov 30, 2017 11:33 pm Post subject: Reply with quote

Disciple

Joined: 09 Nov 2006
Posts: 179
Location: UK

Hi,

We would be better able to offer help if you provided detail of the BIP error being thrown in this case in addition to the exception stack trace.

When you say

Quote:

.. I saw following exception in my application when run in a multi-threaded mode and having a call to getJDBCType4Connection() method in a user defined method in one of the JCNs.

...

I do not see this exception when run in multi threaded mode and having a call to getJDBCType4Connection() method inside evaluate() method in one of the JCNs.


Is it that your "method in a user defined method" is actually a method in an additional separate class from the class implementing the Java compute node, and hence constructed by your own code?

It's likely that the getJDBCType4Connection() call can only be made in methods on the class that is extending "com.ibm.broker.javacompute.MbJavaComputeNode" and internally instantiated by the IIB system to execute the flow Java Compute node.


My suggestion would be that if you want to instantiate and call other user provided classes from a Java Compute node that will process the database interaction, then make the getJDBCType4Connection() in the provide class for the Java Compute node during the onitialize() or evaluate() method and pass the Connection object into your own classes.

HTH
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexWebSphere Message Broker SupportJDBC connection in message broker
Jump to:



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP


Theme by Dustin Baccetti
Powered by phpBB 2001, 2002 phpBB Group

Copyright MQSeries.net. All rights reserved.