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.
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.
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