a standard XPage will time out and the connection will be lost. If this is an issue there is a Stay Active control in the Extension Library that will regularly ping the server and thus keep the session active. I don't use that but have another process that does the same thing along with some other processes, but I'm guessing that this is probably your issue here.
The session time out can be set on the XPages Properties, I believe by default it is 30 minutes but can be set to a longer time. Initially I had it set to 30 minutes and was working on a document composing a descriptive Rich Text field. I worked on it for about and hour or more then tried to save it and lost everything (I know I should have done incremental saves) but ..... It generally is only an issue when editing a document. There are a number of threads on StackoverFlow dealing with this issue as well as I think there is something on OpenNTF.
In any case I think this is your issue and it really probably is not exclusively related to the $$ajaxid but to the session time out.