|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MbNode methods not accessible outside of Java Compute Node |
« View previous topic :: View next topic » |
Author |
Message
|
jboller001 |
Posted: Tue Aug 22, 2006 1:30 pm Post subject: MbNode methods not accessible outside of Java Compute Node |
|
|
 Apprentice
Joined: 31 May 2006 Posts: 40
|
I'm planning on creating a class that will serve as a single point of access for interacting with a particular database table. I've defined various CRUD methods in this class that will be available to all of my Java Compute Nodes. Also, I'd like to use the MbSQLStatement class for its transaction and connection management capabilities. I really don't want to spend time writing a JDBC connection pool.
I created a class that extends MbNode hoping that the createSQLStatement and other methods (getExcecutionGroup etc.) would be available to me. I've discovered that extending this class alone does not do the trick. When I run a transaction, the flow hangs on the line that calls createSQLStatement or any other MbNode method. I tried implenting the MbNodeInterface, extending MbJavaCompute and extending MbInputNode and have not had any luck.
Does anyone know how to utilize the MbSQLStatement class outside of a Java Compute Node?
Thanks, |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Aug 22, 2006 2:10 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You can't use the MbSQLStatement class outside of a Broker JVM. This can be either inside a JCN or inside a Java plugin.
You also can't simply create an MbNode "on the fly".
You can have all of your JCNs pass in a reference to themselves, and then use that within your service class. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
jboller001 |
Posted: Tue Aug 22, 2006 3:16 pm Post subject: |
|
|
 Apprentice
Joined: 31 May 2006 Posts: 40
|
Thanks, passing the JCN referenced worked. |
|
Back to top |
|
 |
jboller001 |
Posted: Tue Aug 22, 2006 5:30 pm Post subject: |
|
|
 Apprentice
Joined: 31 May 2006 Posts: 40
|
This may be a dumb question but would there be a significant performance hit having a JCN pass a reference to itself to another class for every message? |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Aug 23, 2006 1:47 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Well, there's going to be a performance hit for instantiating the class, but that's going to be small.
And passing a reference shouldn't be a large performance hit either...
And you have good reason for putting reusable logic in one place instead of many, so any miniscule performance hit is justfified.
On the other hand, you don't want to layer in ten classes, and pass everything ten classes down and back just because it makes a pretty class diagram. A flatter hierarchy does perform better - but two layers instead of one isn't going to make much difference.
But if you're really concerned about performance, you need to have business requirements for performance that you can measure and then tests that can measure the performance and the ability to gather metrics to determine if the tests passed or failed. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|