web stats
Halt not working - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 02-08-2019, 08:54 AM
StickyBandit's Avatar
StickyBandit StickyBandit is offline
Mirth Guru
 
Join Date: Aug 2013
Location: Home Alone
Posts: 921
StickyBandit is on a distinguished road
Red face Halt not working

I have a channel that says "stopping" I have tried halt, it does not work.
The only way to stop this channel seems to be restarting Mirth Connect, but we don't want to do this because this is our live production box that is constantly getting data.

What can I do to get halt to actually halt the channel?

Mirth Connect Server 3.6.1
Built on July 13, 2018
Java version: 1.8.0_181
Reply With Quote
  #2  
Old 02-14-2019, 11:48 AM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 802
agermano is on a distinguished road
Default

Do you know where in your code the channel is getting stuck? Some endless loop condition that it isn't breaking out of or something?
Reply With Quote
  #3  
Old 02-14-2019, 01:49 PM
StickyBandit's Avatar
StickyBandit StickyBandit is offline
Mirth Guru
 
Join Date: Aug 2013
Location: Home Alone
Posts: 921
StickyBandit is on a distinguished road
Default

It happens when it is unable to execute a SQL DELETE statement, (maybe because a row is locked or something).
There is a grayed out message that never finishes and the channel just gets permanently stuck.
Reply With Quote
  #4  
Old 02-15-2019, 08:07 AM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 802
agermano is on a distinguished road
Default

I think it's possible to set a timeout on the connection before you issue the delete so that it won't hang forever. I don't know if timing out cancels the pending request or not. You might also want to turn auto-commit off to make sure it rolls back.
Reply With Quote
  #5  
Old 02-25-2019, 07:32 AM
StickyBandit's Avatar
StickyBandit StickyBandit is offline
Mirth Guru
 
Join Date: Aug 2013
Location: Home Alone
Posts: 921
StickyBandit is on a distinguished road
Red face more info

I am not using Javascript but rather the built in UI database writer destination.

See the attached image.

Can we do timeout and auto-commit on this screen?
Attached Images
File Type: jpg archive1.jpg (298.7 KB, 7 views)
Reply With Quote
  #6  
Old 06-20-2019, 04:53 PM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 802
agermano is on a distinguished road
Default

You can't do it there. It needs to be set on the Statement. This is untested, but I think it should work. If you do this in a Database Writer in javascript mode, it should Queue on error (including timeout.)

Code:
var dbConn, stmt;
var query = 'DELETE FROM usiis.load_arch_vac WHERE load_seq_no = ? AND load_seq_child = ?';
var timeout = 300; // in seconds

try {
    dbConn = DatabaseConnectionFactory.createDatabaseConnection('oracle.jdbc.driver.OracleDriver',$('usiis.connection-url'),$('usiis_username'),$('usiis_password'));

    stmt = dbConn.getConnection().prepareStatement(query);
    stmt.setQueryTimeout(timeout);
    stmt.setObject(1, $('load_seq_no'));
    stmt.setObject(2, $('load_seq_child'));
    stmt.execute();
    var numRows = stmt.getUpdateCount();
    stmt.close();

    return new Response(Status.SENT, null, "Database write success, " + numRows + " rows updated");
} finally {
    if (dbConn) { 
        dbConn.close();
    }
}

Last edited by agermano; 06-20-2019 at 04:58 PM.
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 10:36 PM.


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