Monday, 26 November 2012

RFC Connections remain in SM04

Known problems:

Note 900132 Remaining user contexts, remaining locks
Note 1261669 RFC connections are not closed
Note 864455 SosGetAnchor error message relating to SNC and BEx
Note 1660720 Session remains open after the logoff on enterprise portal.
If you suspect RFC connections are not being logged off check SM04, it should show many RFC connections



The last request time will be shown here but to verify the last request date choose the relevant entry in SM04 then goto "User" in the Menu and then "Technical Information":





The date and time of the last request will be shown in the field modeinfo[0].diatime, for example:





Note 568271 describes the "lifetime of an RFC connection".
The note indicates that whoever opens the RFC connection must also close it. It is up to the application that opened the connection to close it when it has finished.
According to this note it is the responsibility of RFC caller to close the connection. A client program opens the connection for calling funtion module(s) and has to close this connection,
as soon as this connection is in use any more.
On the R/3 side the connections are kept for the total time where the client transaction is active.
Most applications choose not to do any special handling and so the system defaults to keeping the RFC connection
open as long as the context (ie. transaction) is active to avoid re-authentication and session establishment.
Thus, RFC connections are held until a transaction is finished. This is the way that RFC connections were designed to work. The RFC connectiondoes not close until the transaction is exited.
This is because of performance issues, since setting up a connection and its server side session is time/space consuming.
For external RFC clients, such as C- or visual basic programs, the programmer has to close the connection via RfcClose function. If the client side opens then connection it is also upto them to close
the connection.
To find out exactly which function module is being used Note 780817 "Analyzing the RFC user in SM04" is very useful
If problems occur when using the Visual Composer please check the solution on note 1254158
Visual Composer doesn't close RFC connections with backend.


In relation to portal connectons please see the following part of note 1507034:
"RFC connections from the Portal will remain after logoff The sessions in the backend remain alive while the connection remains in the free connections j2ee pool.
To reduce the time that the connections remain open, you can decrease the connection lifetime following SAP Note 809954:
Go to Visual Admin -> server -> services -> Connector Container ->
com.sapportals.connectors.sap -> SAPFactory -> Managed Connection
Factory -> Connection Definition, and set the Connection Lifetime to,
for example 60 (or even less).

This will mean that after 60 seconds, open connections will be released
from the pool and the session in the backend will be closed (do not set
Connection Lifetime to 0, it means the Connection lifetime never
expires)."

No comments:

Post a Comment