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 Index » WebSphere Message Broker (ACE) Support » Calling dynamic SP

Post new topic  Reply to topic
 Calling dynamic SP « View previous topic :: View next topic » 
Author Message
gilc
PostPosted: Thu Mar 17, 2011 1:39 am    Post subject: Calling dynamic SP Reply with quote

Apprentice

Joined: 17 Mar 2011
Posts: 32

Hello,

In the current project that I'm working on there's a need to call many stored procedures from an Oracle DB.
Because there are many SP to call with different types and numbers of paramers we build a dynamic code in java using JavaComputeNode that handles the connection and calling of the SP.
We used getJDBCType4Connection to establish connections with various JDBCProviders.
Unfortunately, there are some SP that must commit in their code. BUT as I know, when using getJDBCType4Connection you can't commit nor rollback inside SP.
The only 2 solutions I thought about were:
1. Getting a connection using DriverManager (and close it in the end) but then I'm taking away the responsibilty of managing connections from the broker.
2. Using ComputeNode and ESQL to call SP but then I can't change dynamiclly the name of the SP and its parametes.

So finally after a long introduction, I'm asking you guys -
Do you know of a better way to execute what I need? Do you have any insights about the things I said?

Thank you for the help,
Gil
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Thu Mar 17, 2011 5:39 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

You need to think more creatively about how Broker works. I would suggest not using two-phase commit directly, but handling rollbacks through the exception processing capability of Broker.

http://publib.boulder.ibm.com/infocenter/wmbhelp/v7r0m0/index.jsp?topic=/com.ibm.etools.mft.doc/ac00645_.htm

I would recommend you not override Broker's management of connections, as why pay so much money for Broker licenses if you just going to custom code anyway?

More research on your part is needed to exploit the usefulness of Broker. have you taken the class on Advanced Broker Development?

http://www-304.ibm.com/jct03001c/services/learning/ites.wss/au/en?pageType=course_description&includeNotScheduled=y&courseCode=WM663AU

SPs are not "must commit". You can have a version of SP that works better with Broker. Think about it.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
gilc
PostPosted: Thu Mar 17, 2011 6:16 am    Post subject: Reply with quote

Apprentice

Joined: 17 Mar 2011
Posts: 32

Thank you for the reply.

I've been working with broker a few years now and I know its capabilities and its features.
I know that it's not a great idea to use a two phase commit, but our customer needs these commits because we are integrating from BizTalk and they don't want to change all their code in the DB that have been working fine for years.

Any more ideas or insights?
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Thu Mar 17, 2011 6:24 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

There is a reason they are migrating from BizTalk. That reason is: WMB works better than BizTalk.

Reusing BizTalk stored procedures is a bad idea. Don't handicap WMB performance because of BizTalk's shortcomings.

If BizTalk were such a good product, they would still be using BizTalk, but they are not. Use your powers of persuasion to help them make an informed decision.

You can reuse much of the Stored Proc code, but to promote WMB's best use of the logic, you may need to restructure it. This is an opportunity to excel, embrace it.

Convince them they need to be more flexible in their thinking.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
kimbert
PostPosted: Thu Mar 17, 2011 6:25 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

well....there's always ESQL evaluate. Slow but effective.

I only mention it in the hope that somebody will suggest something more elegant.
Back to top
View user's profile Send private message
john01
PostPosted: Thu Mar 17, 2011 6:53 am    Post subject: Reply with quote

Novice

Joined: 16 Jun 2010
Posts: 21
Location: PT

Take a look about:
- call java methods through esql.
- eval
- passthrough

Be careful about performance!
Back to top
View user's profile Send private message
gilc
PostPosted: Thu Mar 17, 2011 7:15 am    Post subject: Reply with quote

Apprentice

Joined: 17 Mar 2011
Posts: 32

Thanks again for all the replies.

EVAL solves only half of the problem because it the declaration of the function\procedure will be static - meaning that i'll still have to declare a different procedure for each SP.
It only helps calling an already declared procedures dynamically.

Passthru isn't very good for SP because it lacks many options such as using out parameters.

Calling JAVA method through esql is the same for me as calling an EXTERNAL procedure with LANGUAGE DATABASE in esql.
And so I think I won't have any other choice than going with this solution.....
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Calling dynamic SP
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.