web stats
Database Reader with Cron-Scheduler polls multiple times - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 02-25-2016, 04:24 AM
rauchj rauchj is offline
OBX.1 Kenobi
 
Join Date: Feb 2014
Location: Freiburg, Germany
Posts: 43
rauchj is on a distinguished road
Default Database Reader with Cron-Scheduler polls multiple times

Hello everyone,

i created a Database-Reader (Oracle) with a cron-scheduler. The Destination is an CSV-file located on an windows-share with append-policy.

When the database-reader starts polling, it seems that the sql-query is executed multiple times, not just once. With option set "poll once at start", the results are polled once as expected. When the cron-scheduler is at work, the results are polled multiple times again.

With the interval-scheduler this behaviour seems not to be the case, but that's not what I need.

I can't get my head around this. Any suggestions?

mirth 3.3.2
Windows 7 x64
MS SQL-Server 2014 Express x64
channel-config is attached
Attached Files
File Type: xml Report TEST.xml (22.6 KB, 8 views)
Reply With Quote
  #2  
Old 02-25-2016, 08:46 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,124
narupley is on a distinguished road
Default

The first cron expression you're using is "* 0,30 12-16 * * ?". That's going to execute once every second during the 0th and 30th minute, during the hours of 12-4 PM. I think instead you want something like this:

Code:
0 0,30 12-16 * * ?
That will execute only on the 0 second mark of the 0th and 30th minutes of hours 12-4 PM. Similarly, you may want to change your second expression to this:

Code:
0 0 7 * * ?
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
  #3  
Old 02-25-2016, 10:42 AM
rauchj rauchj is offline
OBX.1 Kenobi
 
Join Date: Feb 2014
Location: Freiburg, Germany
Posts: 43
rauchj is on a distinguished road
Default

oh boy, i'm an idiot -.-

thank you!
Reply With Quote
  #4  
Old 03-31-2017, 07:44 AM
kirbykn2's Avatar
kirbykn2 kirbykn2 is offline
Mirth Guru
 
Join Date: Sep 2014
Location: Michigan
Posts: 577
kirbykn2 is on a distinguished road
Default CRON Suggestion

So if I wanted the reader to fire daily at 7:40 AM, would this be the correct syntax?

0 40 7 * * ?
__________________
Kirby

Mirth Certified|Epic Bridges Certified|Cloverleaf Level 2 Certified

Appliance Version 3.11.2
Mirth Connect Version 3.6.1
Java Version 1.6.0_45-b06
Java (64 bit) Version 1.6.0_45-b06
Java 7 (64 bit) Version 1.7.0_151-b15
Java 8 (64 bit) Version 1.8.0_121-b13
PostgreSQL Version 9.6.3
Reply With Quote
  #5  
Old 03-31-2017, 02:06 PM
jack.downes jack.downes is offline
OBX.2 Kenobi
 
Join Date: Apr 2014
Posts: 64
jack.downes is on a distinguished road
Default

if you mouse over that interval section, you'll see it's got a helper associated with it. I use the unix crontab manpage for help, but then again, that doesn't have seconds resolution - be aware of that.

Short answer is that your 7:40am crontab is correct.
Reply With Quote
  #6  
Old 03-31-2017, 02:14 PM
kirbykn2's Avatar
kirbykn2 kirbykn2 is offline
Mirth Guru
 
Join Date: Sep 2014
Location: Michigan
Posts: 577
kirbykn2 is on a distinguished road
Default

Thanks for the confirmation Jack.

For others, I found these resource while researching this today.

http://www.adminschoice.com/crontab-quick-reference
__________________
Kirby

Mirth Certified|Epic Bridges Certified|Cloverleaf Level 2 Certified

Appliance Version 3.11.2
Mirth Connect Version 3.6.1
Java Version 1.6.0_45-b06
Java (64 bit) Version 1.6.0_45-b06
Java 7 (64 bit) Version 1.7.0_151-b15
Java 8 (64 bit) Version 1.8.0_121-b13
PostgreSQL Version 9.6.3
Reply With Quote
  #7  
Old 04-03-2017, 07:33 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,124
narupley is on a distinguished road
Default

Yes that's correct, but if you're doing something as simple as "daily at 7:40" then you don't even need the Cron option. Just use the "Time" option, which behaves the same way it did in 3.2 and earlier.
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
  #8  
Old 04-03-2017, 08:15 AM
kirbykn2's Avatar
kirbykn2 kirbykn2 is offline
Mirth Guru
 
Join Date: Sep 2014
Location: Michigan
Posts: 577
kirbykn2 is on a distinguished road
Default

The requirement is to send every day at 8AM, noon and 7PM.
__________________
Kirby

Mirth Certified|Epic Bridges Certified|Cloverleaf Level 2 Certified

Appliance Version 3.11.2
Mirth Connect Version 3.6.1
Java Version 1.6.0_45-b06
Java (64 bit) Version 1.6.0_45-b06
Java 7 (64 bit) Version 1.7.0_151-b15
Java 8 (64 bit) Version 1.8.0_121-b13
PostgreSQL Version 9.6.3
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 05:19 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation