web stats
Connection: Polling - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Thread Tools Display Modes
Old 02-24-2013, 11:54 PM
CrisHosp CrisHosp is offline
OBX.1 Kenobi
Join Date: Feb 2013
Posts: 27
CrisHosp is on a distinguished road
Unhappy Connection: Polling

Hi to everyone!

I'm using Mirth for moving PDF files, the use is simple

source: reads from a folder (smb protocol)
destination: writes the file in another folder and changes the name.
transformer (destination): write some SQL sencences.

It usually works but sometimes I don't know why the channel changes to 'Polling' for a long time, it has files to read and it doesn't read any till I restart Mirth again.

I have this problem since May, and this channel must be working always, but sometimes I realize it's not reading files and I have to restart.

Does anyone know the reason? is it a kind of bug? I've tried to find if there is any thread about this, but i couldn't find anything.
Reply With Quote
Old 02-25-2013, 06:35 AM
cory_cole cory_cole is offline
Mirth Guru
Join Date: Mar 2012
Posts: 1,361
cory_cole is on a distinguished road

It sounds like the channel is hanging. The only code you are indicating is SQL. There is a possiblity that there is a dead lock or loop in the code that generates the SQL that doesn't have a way out. If you can post your channel here, someone on the forum can help.
Reply With Quote
Old 02-26-2013, 02:17 PM
srowe srowe is offline
Mirth Newb
Join Date: Sep 2009
Location: Spokane, Washington, USA
Posts: 15
srowe is on a distinguished road

We had a similar issue with polling (unrelated to files or SQL, but web services) and resolved it by moving to v2.2.1. Before we were able to upgrade, we worked-around the issue by re-deploying the channel using another channel.
Reply With Quote
Old 02-27-2013, 02:33 AM
CrisHosp CrisHosp is offline
OBX.1 Kenobi
Join Date: Feb 2013
Posts: 27
CrisHosp is on a distinguished road
Post transformer's code

Hi to everyone,
First of all, thanks for your replies!! I put the code if it can help to get a solution.

Sorry for some spanish tags

var dbConn = DatabaseConnectionFactory.createDatabaseConnection ('xxx','xxx','xxxxx','xxxxx');
var sql='select pers.docu_key as docu_key from pati, pers where pers.pers_key=pati.pers_key and pati.pati_hfn =' + nhc;
var result = dbConn.executeCachedQuery(sql);

if(result.next()){ //PACIENT FOUND

var docu_key = result.getString("docu_key");

var tipo_doc = fichero.substr(0,3);
var nomfich = nhc + '_' + tipo_doc + '_' + fechaHora + ".pdf";


var sql='select count(*) as lineas from phisdocu where docu_key=' + docu_key +
' and datavolucode =' + tipo_doc + ' and phisdocuname="' + nomfich + '"';
var result = dbConn.executeCachedQuery(sql);

if(result.getString("lineas")==0){ //IF IT DOESN'T EXIST


var result=dbConn.executeUpdate("INSERT INTO phisdocu (docu_key, phisdocu_key, datavolucode, phisdocuname, phisdocuvolupath, phisdocu_url, phisdocudate, phisdocuanul)"+
" VALUES (" + docu_key + ", " + cont + ", '" + tipo_doc + "', '" + nomfich.toString() + "', '" + anyo_examen + "', 'N', '" + datestring + "', 'N')");
var ruta_dest = tipo_doc + '/' + anyo_examen;
//logger.info("Documento insertado correctamente");
var ruta_dest='errores';
var nomfich = fichero;
var tipo_error = "Error al insertar en phisdocu";
var ruta_dest='errores';
var nomfich = fichero;
var tipo_error = "El fichero ya existe en phisdocu";

It only happens to me in this channel and it seems that everything is ok with the code apparently...

Thanks in advance!

Last edited by CrisHosp; 02-27-2013 at 02:39 AM. Reason: Wrong title
Reply With Quote

file, pdf, polling, restart, smb

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 08:43 AM.

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