web stats
Mirth Community - View Single Post - Java Null Pointer Exception when polling DB
View Single Post
  #11  
Old 09-04-2019, 09:47 AM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 1,159
agermano is on a distinguished road
Default

When using a db reader, the entire ResultSet from the query is returned, and each row becomes a new message. I believe they are processed in order on a single thread even when multiple source threads are enabled unless you also have the source queue turned on (at which point out-of-order processing is possible when using more than one thread.)

Are you saying the documentID may not be unique in the PatientendatenScancenter table, but you only want to process once per documentID per poll? If it is not unique, is there another unique record identifier for that table?

The usual way to use the Database Reader is to only place the select statement in your SQL section. The update statement would be placed in the "Run Post-Process SQL" section, and you can set it to run "After each message." The documentID for the current message will be available in the Post-Process section. This way you are not updating the record at the time of the query, but rather when processing of that record is complete.
Reply With Quote