Author |
Message
|
sambati |
Posted: Wed Sep 09, 2009 1:25 am Post subject: WBIMB Clarification |
|
|
Novice
Joined: 14 Nov 2006 Posts: 19
|
Hi,
This is ambati, I need a clarification on MB.
I have one requirement. i.e My message flow is keep on appending a file in a physical location. Cron job will take this physical file at a certain time.
If that cron job is looking for taking that file at mentioned time, at the same time if our flow also appending the message in the same file. Will that file corrept or our broker transaction will keep that till broker transaction finishes.
Can any one help on this please. |
|
Back to top |
|
 |
WMBDEV1 |
Posted: Wed Sep 09, 2009 1:44 am Post subject: Re: WBIMB Clarification |
|
|
Sentinel
Joined: 05 Mar 2009 Posts: 888 Location: UK
|
sambati wrote: |
Cron job will take this physical file at a certain time.
|
Explain "take". Do you mean copy or move?
If it tries to move it I suspect it will fail.
If it tries to copy it, I suspect it will copy whatever the file looks like at that point in time, which will probably lead to the copy being corrupted. |
|
Back to top |
|
 |
Monk |
Posted: Wed Sep 09, 2009 3:13 am Post subject: |
|
|
 Master
Joined: 21 Apr 2007 Posts: 282
|
Quote: |
If that cron job is looking for taking that file at mentioned time, at the same time if our flow also appending the message in the same file. Will that file corrept |
Well , in this case ,its quite difficult to say what will happen.
and btw why would you want to read and write to file from two process at the same time, the results in such cases are always unpredictable. _________________ Thimk |
|
Back to top |
|
 |
sambati |
Posted: Wed Sep 09, 2009 5:00 am Post subject: If that cron job is looking for taking that file at mentione |
|
|
Novice
Joined: 14 Nov 2006 Posts: 19
|
Hi WMBDEV1 and Monk,
Thanks for your reply.
My message flow is continously append the records in a file. Cron job has to pickup(Remove in current location) that file and has to place in a remote location at specified time ex: 10:00AM. My problem is, when our transaction is appending records, if that cron job has started at 10:00am. will it corrept that file?
I thought transaction will hold till MB finishes its work.
Could you suggest me please? |
|
Back to top |
|
 |
Vitor |
Posted: Wed Sep 09, 2009 5:05 am Post subject: Re: If that cron job is looking for taking that file at ment |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
sambati wrote: |
I thought transaction will hold till MB finishes its work. |
What transaction? Files on most OS are not transactional.
sambati wrote: |
Could you suggest me please? |
Redesign. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
sambati |
Posted: Wed Sep 09, 2009 8:51 pm Post subject: when our transaction is appending records |
|
|
Novice
Joined: 14 Nov 2006 Posts: 19
|
Hi,
Thanks for your reply
I mean to say our flow is appending the records into file, if that cron job invokes. Will our flow will corrupt? |
|
Back to top |
|
 |
WMBDEV1 |
Posted: Thu Sep 10, 2009 12:27 am Post subject: Re: when our transaction is appending records |
|
|
Sentinel
Joined: 05 Mar 2009 Posts: 888 Location: UK
|
sambati wrote: |
Hi,
Thanks for your reply
I mean to say our flow is appending the records into file, if that cron job invokes. Will our flow will corrupt? |
From my previous comment, I suspect it will fail in the case where the file is attempted to be moved.
What happens when you try it? |
|
Back to top |
|
 |
sirsi |
Posted: Thu Sep 10, 2009 1:58 am Post subject: |
|
|
Disciple
Joined: 11 Mar 2005 Posts: 177
|
|
Back to top |
|
 |
sambati |
Posted: Thu Sep 10, 2009 3:13 am Post subject: |
|
|
Novice
Joined: 14 Nov 2006 Posts: 19
|
|
Back to top |
|
 |
sirsi |
Posted: Thu Sep 10, 2009 4:28 am Post subject: |
|
|
Disciple
Joined: 11 Mar 2005 Posts: 177
|
its better if u check in ur cron script if file is being used before moving it... OR tell broker to wait for few minutes when clock ticks 10AM(u can do this by calling a simple java program)... |
|
Back to top |
|
 |
sambati |
Posted: Thu Sep 10, 2009 8:09 pm Post subject: |
|
|
Novice
Joined: 14 Nov 2006 Posts: 19
|
Thanks for your reply,
if you have Please provide me java code to stop broker for some time at 10AM. |
|
Back to top |
|
 |
WMBDEV1 |
Posted: Fri Sep 11, 2009 1:05 am Post subject: |
|
|
Sentinel
Joined: 05 Mar 2009 Posts: 888 Location: UK
|
sambati wrote: |
Thanks for your reply,
if you have Please provide me java code to stop broker for some time at 10AM. |
OMG, whats happened to this thread? How did it come to this?
Cant you have a solution where the broker inserts to a file for a period of time (say a day) and then starts a new file. The job to pick this file up can then run say an hour after the broker is meant to have finished its work and all should be well. |
|
Back to top |
|
 |
sirsi |
Posted: Sat Sep 12, 2009 12:08 am Post subject: |
|
|
Disciple
Joined: 11 Mar 2005 Posts: 177
|
WMBDEV:
if sambati could use different file names he wouldnt have started the thread I believe
sambati:
a simple java program using sleep() function will do the work for you...just call this java program from broker flow, it will delay the execution of flow for 5min and then flow continues execution as usual... |
|
Back to top |
|
 |
harish_td |
Posted: Sat Sep 12, 2009 1:13 am Post subject: |
|
|
Master
Joined: 13 Feb 2006 Posts: 236
|
sirsi wrote: |
sambati:
a simple java program using sleep() function will do the work for you...just call this java program from broker flow, it will delay the execution of flow for 5min and then flow continues execution as usual... |
Do this at your own risk....The concept of passing control to a Java Compute which does sleep() seems like overkill.
Dynamic file names and a modified cron job which only picks the previous hour's file(s) is the way to go. Happy Broker, Happy Cron, Happy Support teams. |
|
Back to top |
|
 |
WMBDEV1 |
Posted: Sat Sep 12, 2009 5:15 am Post subject: |
|
|
Sentinel
Joined: 05 Mar 2009 Posts: 888 Location: UK
|
sirsi wrote: |
if sambati could use different file names he wouldnt have started the thread I believe
|
Why would this be the case? Assume nothing.
If he needs the file to be called something specific then just rename it as part of the scheduled process that collects the file!
The process as suggested seems really messy to me; that was all  |
|
Back to top |
|
 |
|