简体   繁体   English

Mirth Connect 接口引擎上的 dbConn.executeCachedQuery(SQLStatement) 问题

[英]Question to dbConn.executeCachedQuery(SQLStatement) on Mirth Connect Interface Engine

Because of too low set of max limit of processes and sessions in an Oracle DB, sometimes the following error occurs in mirth:由于 Oracle DB 中进程和会话的最大限制设置过低,有时会在 mirth 中出现以下错误:

DBConnection - java.sql.SQLException: Listener refused the connection with the following error: ORA-12516, TNS:listener could not find available handler with matching protocol stack DBConnection - java.sql.SQLException:侦听器拒绝连接并出现以下错误:ORA-12516,TNS:侦听器找不到具有匹配协议堆栈的可用处理程序

due to dbConn.executeCachedQuery(SQLStatement) with the DatabaseConnection Class in Mirth由于 dbConn.executeCachedQuery(SQLStatement) 与 Mirth 中的DatabaseConnection

So these are my questions:所以这些是我的问题:

  1. Is there any way to throw this response/exception in the channel?有没有办法在频道中抛出这个响应/异常?
  2. Is all data of the SQL query with the exception "lost", if this error occurs or is there an automatic retry? SQL 查询的所有数据是否“丢失”异常,如果发生此错误或是否有自动重试?
  3. And is there a best practice to handle this (eg to check first the the connection with a getConnection() method)?是否有处理此问题的最佳实践(例如,首先使用getConnection()方法检查连接)?

I'll answer your questions in order:我会按顺序回答你的问题:

1) If you are using the javascript connector, then you should have this in a try catch when you initiate the connection. 1) 如果您使用的是 javascript 连接器,那么您应该在启动连接时将其放入 try catch 中。 In the catch, just put the error as Logger.Error(exceptionGoesHere).在捕获中,只需将错误输入为 Logger.Error(exceptionGoesHere)。

If you are using the db connector this should get throw automatically in the logs.如果您正在使用 db 连接器,这应该会在日志中自动抛出。 To make sure you have logging enabled at the channel level, access the Mirth Connect Server Manager, click on the Server tab and ensure that Channel Log Level is at least set to Error.要确保在通道级别启用日志记录,请访问 Mirth Connect 服务器管理器,单击服务器选项卡并确保通道日志级别至少设置为错误。

2) The way that Mirth Connect works, every time the message is initiated it will hit certain points of the Mirth DB to save the state of the message at that point in time. 2) Mirth Connect 的工作方式是,每次发起消息时,它都会击中 Mirth DB 的某些点以及时保存消息在该时间点的状态。 It's how Mirth guarantees message delivery.这就是 Mirth 保证消息传递的方式。 With that being said, you can always 'retry' the send manually.话虽如此,您始终可以手动“重试”发送。 Otherwise, if you are using the DB connector there's an option that handles this for you under the Database Reader Settings section.否则,如果您使用的是 DB 连接器,则在 Database Reader Settings 部分下有一个选项可以为您处理此问题。 The retry gives you the option to select the number of retries as well as the Retry interval in ms.重试使您可以选择重试次数以及以毫秒为单位的重试间隔。 When I was working there, by default it was set to 3 retries after 10 seconds.当我在那里工作时,默认设置为 10 秒后重试 3 次。

3) Use the default database connector. 3) 使用默认的数据库连接器。 Everything's already built in for you.一切都已为您内置。 Put the extra processing in the transformer to handle anything else.将额外的处理放在变压器中以处理其他任何事情。 Don't try to re-invent the wheel if everything is already built is the best practice.如果一切都已构建是最佳实践,请不要尝试重新发明轮子。

If you insist on using a code solution, then make sure all of your code is in a try catch, and make sure your catch is actually logging out the error exception.如果您坚持使用代码解决方案,那么请确保您的所有代码都在 try catch 中,并确保您的 catch 实际上正在注销错误异常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM