views:

20

answers:

1

Hi,

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

A: 

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:

  • the agent runs fine but there's an error in the log related to sending messages.
  • Any other agents that send mail will also be affected.
  • It works fine for weeks, even months, then suddenly stops working.
  • and unfortunately, the only fix I've ever found is to reboot when it happens.
Ken Pespisa
Thank you Ken. The symptoms are similar to the ones you mention... but we're getting this error message on the Windows server console:Microsoft SQL Server LoginConnection failed:SQLState: 'S1T00'SQL Server Error: 0[Microsoft][ODBC SQL Server Driver] Timeout expiredSo I still think I should try and manage better my SQL connection from the agent... don't you think?
frenetix
Yeah, it's not exactly the same issue I faced. You could look into an alternative method of getting the data. I've used both the LC LSX connections and just a plain old CreateObject("ADODB.Connection") to get data from SQL into Notes. Perhaps you could start there, by writing another agent using an alternative to the ODBCConnection classes?
Ken Pespisa