管理 Lotus Notes Agent 上不稳定的 SQL 连接
我有一个正在工作的 Lotus Notes 代理。在 LN 7 上运行。 我的代理每 5 分钟运行一次,每当它在 Microsoft SQL (2005) 表上找到某些特定记录时,它就会发送一些邮件。
它通常工作正常,但最近它停止工作 - 不止一次 - 并且不会再次重新启动,直到 Notes 服务器重新启动或 Notes 管理员重新启动所有代理(我不是 Notes 管理员,所以我不是真的确定他做了什么,我正在尝试获取此信息以添加到此问题中)。
我试图排除我能想到的任何事情,我想到的唯一一件事是我的 LN 代理运行查询的 MS SQL Server 存在一些稳定性问题,并且可能并不总是在线...我想这可能是问题的原因...(我试图将 SQL 中的正常运行时间日志与我的代理上次成功完成的时间进行交叉引用)。
我在想除了我正在做的之外是否有任何方法可以管理连接,这样我就可以排除(缺乏)连接问题。
预先感谢您提供的任何建议。
亲切的问候,
迭戈
Option Public
Uselsx "*LSXODBC"
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim subject As String, cc As String, bcc As String, sender As String, OID As String, mailto As String, bodyNotMIME As String
Dim body As NotesMIMEEntity
On Error Goto errorCounter
Set db = session.CurrentDatabase
Gosub SendMailGeneral
Exit Sub
SendMailGeneral:
Dim con As New ODBCConnection
Dim qry As New ODBCQuery
Dim result As New ODBCResultSet
Dim defaultQuery As String
Set qry.Connection = con
If con.ConnectTo("DSN_Name","USER_NAME", "PASSWORD") Then
Set result.Query = qry
defaultQuery = "select TOP (10) * from Message where StatusType=0"
qry.SQL = defaultQuery
result.Execute
If (result.IsResultSetAvailable) Then
Do
result.NextRowcode
//here´s all the code that gets the results from each table´s fields and transform them into notes mails
Loop Until result.IsEndOfData
End If
End If
result.Close(DB_CLOSE)
Return
End Sub
I have a working Lotus Notes agent. Running on LN 7.
My agent runs every 5 minutes, and it sends some mails whenever it finds some specific records on an Microsoft SQL (2005) table.
It usually works ok, but recently it stopped working -more than once now- and won't restart again until the Notes Server is restarted or the Notes admin restarts all the agents (I'm no notes admin, so I'm not really sure what he does, I'm trying to get this info to add to this question).
I'm trying to rule out anything I can think of and the only thing that comes to my mind is that the MS SQL Server on which my LN Agent runs the queries had some stability issues and might not always be online... I thought that that might be the cause of the problem... (I'm trying to cross reference the uptime log from the SQL with the last time my agent has completed successfully).
I was thinking if there's any way to manage the connection, other than what I'm doing, so I can rule out a (lack of) connection problem.
Thanks in advance for any advice you can provide.
Kind regards,
Diego
Option Public
Uselsx "*LSXODBC"
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim subject As String, cc As String, bcc As String, sender As String, OID As String, mailto As String, bodyNotMIME As String
Dim body As NotesMIMEEntity
On Error Goto errorCounter
Set db = session.CurrentDatabase
Gosub SendMailGeneral
Exit Sub
SendMailGeneral:
Dim con As New ODBCConnection
Dim qry As New ODBCQuery
Dim result As New ODBCResultSet
Dim defaultQuery As String
Set qry.Connection = con
If con.ConnectTo("DSN_Name","USER_NAME", "PASSWORD") Then
Set result.Query = qry
defaultQuery = "select TOP (10) * from Message where StatusType=0"
qry.SQL = defaultQuery
result.Execute
If (result.IsResultSetAvailable) Then
Do
result.NextRowcode
//here´s all the code that gets the results from each table´s fields and transform them into notes mails
Loop Until result.IsEndOfData
End If
End If
result.Close(DB_CLOSE)
Return
End Sub
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我遇到了一个非常类似的问题(在 Domino 6.0.4 中),这是由于错误造成的。已经有一段时间了,所以我不记得在哪里发现它报告为但是(可能在notes.net上),但我花了很多时间试图找出解决方法。在我的情况下,唯一的解决方法是重新启动服务器。
让您的管理员在代理触发时检查日志中是否有任何错误消息。您还可以向代理添加一些打印语句,这些语句会写入日志,以确认代理正在运行。
如果您的问题与我的相同,症状将是:
I've had a very similar issue (in Domino 6.0.4) and it was due to a bug. It's been a while so I don't remember where I found that it reported as a but (probably on notes.net), but I spent many many hours trying to figure out a workaround. In my situation, the only fix was to reboot the server.
Have your admin check the logs for any error messages around the time the agent fires. You could also add some print statements to the agent, which get written to the log, just to confirm the agent is running.
If your issue is the same as mine, the symptoms will be:
以防万一其他人也遇到同样的问题:
我们最终发现 SQL 服务器出现了一些超时错误,并且 Notes 服务器上有错误消息提示,该错误消息提示将阻止代理运行,直到单击“确定”按钮( !)。
为了避免服务器上出现这些“视觉”提示错误,我在 OCBC 连接定义中发现了 SilentMode 选项:这是您必须做的:
无论如何,谢谢!
Just in case someone else has this same issue:
We finally found out that there where some timeout errors from the SQL server, and there was an error message prompt on the Notes server that would block the agent for running until clicked on the ok button (!).
In order to avoid these "visual" prompt errors on the server I found out about the SilentMode option on my OCBC connection definition: here's what you have to do:
Thanks anyway!