Author |
Message
|
ibolui |
Posted: Tue Aug 17, 2010 1:20 am Post subject: |
|
|
Novice
Joined: 10 Aug 2010 Posts: 22
|
thanks smdavies99!
i think that may be what i am looking for. but i have no clue and exp at all..
i have googled abit and BEGIN ATOMIC is part of ESQL? can it be used in javacompute node?
can you guide me how it shall be implemented? or is there a tutorial/sample online?
thanks  |
|
Back to top |
|
 |
smdavies99 |
Posted: Tue Aug 17, 2010 1:28 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
I am afraid that this is all ESQL.
however, you can use the data setup in the Environment folder in a JCN.
Are you one of the sites that is Java only? _________________ 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 |
|
 |
ibolui |
Posted: Tue Aug 17, 2010 1:33 am Post subject: |
|
|
Novice
Joined: 10 Aug 2010 Posts: 22
|
yes.. is a all java thing
sorry.. what is data setup in the Environment folder in a JCN? |
|
Back to top |
|
 |
saurabh867 |
Posted: Tue Aug 17, 2010 2:59 am Post subject: |
|
|
Voyager
Joined: 13 Jun 2010 Posts: 78
|
Did you try using any connection pooling apis eg : apache-connection-pool.
Regards,
Saurabh |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Aug 17, 2010 3:30 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Connection Pooling won't necessarily help.
A Java singleton will be available and persistent during the lifetime of a given JVM, in the case of broker this is the entire execution group.
When I asked if the data had to be read each time, and the answer was given as "yes", I don't see how maintaining a cache will help either.
Look at the Cache SupportPac anyway. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Aug 17, 2010 9:39 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
ibolui wrote: |
thanks smdavies99!
i think that may be what i am looking for. but i have no clue and exp at all..
i have googled abit and BEGIN ATOMIC is part of ESQL? can it be used in javacompute node?
can you guide me how it shall be implemented? or is there a tutorial/sample online?
thanks  |
The equivalent of ATOMIC for java would be to have a serialized modifier.
[edit]Shame on me. I meant of course synchronized [/edit] _________________ MQ & Broker admin
Last edited by fjb_saper on Wed Aug 18, 2010 8:23 pm; edited 1 time in total |
|
Back to top |
|
 |
mgk |
Posted: Tue Aug 17, 2010 2:01 pm Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Quote: |
The equivalent of ATOMIC for java would be to have a serialized modifier |
I think you meant synchronized  _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
ibolui |
Posted: Tue Aug 17, 2010 5:23 pm Post subject: |
|
|
Novice
Joined: 10 Aug 2010 Posts: 22
|
Quote: |
When I asked if the data had to be read each time, and the answer was given as "yes", I don't see how maintaining a cache will help either. |
maybe to be clearer in what i am trying to do.. as part of the flow, i will query the database for extraction of some 'profiles' which will be used to determine where to route the messages..
Quote: |
I think you meant synchronized |
hmmm.. i thought synchronized is used for threads issues? how will it helps to improve the database query performance? |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Aug 18, 2010 2:20 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
smdavies99's solution to this problem was to preload the data at regular intervals in a separate flow using a timer node. The data was then stored in an ESQL shared variable, and BEGIN ATOMIC blocks were used around the access points into this shared variable to ensure that access to it was synchronized.
If the data is different enough each time the flow is run such that the data has to be read each time the flow is run - which you have stated! - then this solution can't be done.
But if this solution CAN be done, AND you want to do it in Java, then you can use a Java singleton class with appropriate synchronized modifiers.
Or, as I said, you could choose not to reimplement this wheel and use the Cache supportPac instead. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Aug 18, 2010 10:23 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
mgk wrote: |
Quote: |
The equivalent of ATOMIC for java would be to have a serialized modifier |
I think you meant synchronized  |
Of course. Silly me I need more tea... _________________ MQ & Broker admin |
|
Back to top |
|
 |
ibolui |
Posted: Wed Aug 18, 2010 5:18 pm Post subject: |
|
|
Novice
Joined: 10 Aug 2010 Posts: 22
|
Quote: |
If the data is different enough each time the flow is run such that the data has to be read each time the flow is run - which you have stated! - then this solution can't be done. |
sorry! my bad.. i do not mean the data is different enough each time the flow is run. what i meant is that for each flow, i need to fetch the data inorder to determine where to route the message to..
thanks for the explanation. i seem to understand smdavies99's solution better now. i shall try implementing it..  |
|
Back to top |
|
 |
ibolui |
Posted: Thu Aug 19, 2010 6:00 pm Post subject: |
|
|
Novice
Joined: 10 Aug 2010 Posts: 22
|
i think i have gotten it to work. i followed the Message Routing Sample that comes with the broker..
thanks everyone  |
|
Back to top |
|
 |
|