web stats
Source connector database reader pooling - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 02-19-2020, 06:57 AM
usuariousuario usuariousuario is offline
Mirth Newb
 
Join Date: Sep 2016
Location: Madrid, Spain
Posts: 12
usuariousuario is on a distinguished road
Default Source connector database reader pooling

My question is about the internals of Database reader connectors. NextGen/Mirth Connect versión is 3.5.1

We are trying the usual channel where the source is Database Reader. It does no more, as it is for a test. It queries an external database every minute. It works OK, as expected. But I am wondering how does the channel manages the connection to the external database.

Every minute the channel, does the connector open a new datasource?, does it get a connection, does it query the database? and does it close the connection finally?

I know there is the option "Keep Connection Open", which is supposed to close the connection between queries. But from which datasource does this connection from ? A brand-new one or a one created of first deployment?

In my specific case I am querying against a Microsoft SQL Server 2012, and if I query the sys.dm_exec_sessions there are a lot of sessions open from the mirth instance. Right now there are almost 30 opened sessions and there must be from only one source connector in a test channel, as the rest of the Mirth instance is empty. What am I missing about this behaviuor? No matter if I check "Keep connection open" or not.

Is there a way to configure this in another way?

Where can I see the source code of the Database Reader Connector?

Thank you very much in advance.
Reply With Quote
  #2  
Old 02-19-2020, 09:50 AM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 1,159
agermano is on a distinguished road
Default

Here is the main server class for the Database Reader: https://github.com/nextgenhealthcare...eReceiver.java

Keep connection open only applies to SQL Query mode, and the class for that is here: https://github.com/nextgenhealthcare...iverQuery.java

It appears that it should only have at most 2 connections open at a time (per channel.) It always has an open connection for the query. It will also have a second connection open for doing updates if you have that option selected.
Reply With Quote
  #3  
Old 02-20-2020, 05:27 AM
usuariousuario usuariousuario is offline
Mirth Newb
 
Join Date: Sep 2016
Location: Madrid, Spain
Posts: 12
usuariousuario is on a distinguished road
Default

Thanks agermano, I have been able to test there are two connections (one for the select and one for the update). When I undeploy the channel, two sessions are lost in the sys.dm_exec_sessions view. When I deploy the channel, two sessions are created.

But there are few other ones that I do not still know where they come from. I will keep looking for them. It may seem to be another different issue.

Thank you very much for the quick and clear response.
Reply With Quote
Reply

Tags
database, pool, pooling, reader

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 07:17 AM.


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