Author |
Message
|
kash3338 |
Posted: Mon Jun 17, 2013 5:43 pm Post subject: |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
mqjeff wrote: |
You can use JDBC from a Compute node, if you're careful. |
Is this by invoking a Static Java method from ESQL? |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Jun 18, 2013 5:23 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
kash3338 wrote: |
mqjeff wrote: |
You can use JDBC from a Compute node, if you're careful. |
Is this by invoking a Static Java method from ESQL? |
Can you think of other ways to do it?  |
|
Back to top |
|
 |
kash3338 |
Posted: Tue Jun 18, 2013 5:23 pm Post subject: |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
mqjeff wrote: |
Can you think of other ways to do it?  |
JDBCProviders Configurable services ? |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Jun 19, 2013 5:31 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
kash3338 wrote: |
mqjeff wrote: |
Can you think of other ways to do it?  |
JDBCProviders Configurable services ? |
 |
|
Back to top |
|
 |
kash3338 |
Posted: Wed Jun 19, 2013 6:34 am Post subject: |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
mqjeff wrote: |
kash3338 wrote: |
mqjeff wrote: |
Can you think of other ways to do it?  |
JDBCProviders Configurable services ? |
 |
Isn't that correct? Any other ways? |
|
Back to top |
|
 |
Esa |
Posted: Wed Jun 19, 2013 6:47 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
|
Back to top |
|
 |
mqjeff |
Posted: Wed Jun 19, 2013 6:53 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
|
Back to top |
|
 |
mapa |
Posted: Thu Jun 20, 2013 11:06 am Post subject: |
|
|
 Master
Joined: 09 Aug 2001 Posts: 257 Location: Malmö, Sweden
|
I am an ESQL fan-boy when working with WMB and think that is the languague to use when doing transformations in the broker (at least pre V8 ).
I have actually forbidden both JCN and Mapping nodes at my current customer for mapping between two formats. Mainly to be consistent, Java is fine for special cases but they must be special (meaning hard or impossible to solve with ESQL).
That being said, you must also take into account the skills/knowledge of the coder. I just wasted two days tracking down a production problem before I managed to solve it. A large XML message took longer time to transform than the MQMD expiry...
After looking at the code I made a couple of standard changes, like better use of references and switching from cardinality+while to for+reference.
The problematic processing of the in this case large invoice went from over 4.5minutes to approx 200ms, so using ESQL in itself doesn't make sure it performs better than Java... |
|
Back to top |
|
 |
kimbert |
Posted: Thu Jun 20, 2013 12:15 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5543 Location: Southampton
|
Hmmm. Something tells me that mapa's comment is going to be bookmarked and regularly quoted by the always-use-references-and-never-use-cardinality camp...of which I'm a part-time member.  |
|
Back to top |
|
 |
mapa |
Posted: Thu Jun 20, 2013 12:31 pm Post subject: |
|
|
 Master
Joined: 09 Aug 2001 Posts: 257 Location: Malmö, Sweden
|
Not so sure, that is a standard advise here
Although I was surprised about the difference being that much.
And I do think there is a value in both using a graphical mapping tool and JCN.
Once we move to V9 those options will be revaluated... |
|
Back to top |
|
 |
mqsiuser |
Posted: Thu Jun 20, 2013 2:21 pm Post subject: |
|
|
 Yatiri
Joined: 15 Apr 2008 Posts: 637 Location: Germany
|
Mapa is not (even) mentioning XSLT. Thank you!
mapa wrote: |
switching from cardinality+while to for+reference |
I thought it is while (do, LASTMOVE) + references?
For ... what? EACH? ... (I guess no "i++") ?
Part time "always-use-reference-and-never-use-cardinality"... rest of the time... writing on-demand-parsers. _________________ Just use REFERENCEs |
|
Back to top |
|
 |
kash3338 |
Posted: Thu Jun 20, 2013 7:13 pm Post subject: |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
I still dint get your point on this. Was that right or ..?  |
|
Back to top |
|
 |
smdavies99 |
Posted: Thu Jun 20, 2013 8:58 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
kimbert wrote: |
Hmmm. Something tells me that mapa's comment is going to be bookmarked and regularly quoted by the always-use-references-and-never-use-cardinality camp...of which I'm a part-time member.  |
Whilst you have a point there is a case for at least one use of CARDINALITY.
IMHO, that is to count the number of rows returned in a SELECT and especially complex ones with JOIN(S) which are done via a Stored Proc but at some point you need to verify the result set.
As a consequence, I have used CARDINALITY to verify that the correct number was returned. Less than this and the code would throw an exception.
As the saying goes, "There is always an exception to the rule"
To Mapa,
You can always use references in a while... end while construct. This performs only marginally slower than a FOR construct (at least it did on 6.1.0.9 and it was about 1-2%) _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
kash3338 |
Posted: Fri Jun 21, 2013 12:39 am Post subject: |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
kimbert wrote: |
Hmmm. Something tells me that mapa's comment is going to be bookmarked and regularly quoted by the always-use-references-and-never-use-cardinality camp...of which I'm a part-time member.  |
smdavies99 wrote: |
As a consequence, I have used CARDINALITY to verify that the correct number was returned. Less than this and the code would throw an exception.
As the saying goes, "There is always an exception to the rule"  |
Again it purely depends on the design decision to make use of CARDINALITY. Even for the above mentioned scenario, you can come up with other approaches like,
1. You can make the Stored Procedure do that for you and return the count or to return a error code to verify for the right number of results in result-set.
2. Write a custom function using WHILE/FOR along with REFERENCE. I am sure you will see a difference in performance even here (as quoted by mapa).
But a question here is, why was the CARDINALITY function written in such a way that even a custom written function or procedure can over come that in performance? Why isn't the performance of this particular function enhanced over the time? |
|
Back to top |
|
 |
kimbert |
Posted: Fri Jun 21, 2013 3:36 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5543 Location: Southampton
|
@smdavies99: Exactly. That's why I'm only a part-time member of that club.
@mqsiuser: ...but I don't spend *all* of the rest of my time writing parsers. I've heard of something called 'work/life balance'. Although my wife might disagree with that statement. |
|
Back to top |
|
 |
|