I have a WinForms app which, when it first starts up, firstly creates an OracleConnection, and then calls a stored procedure that writes a record to a user_session table. The OracleConnection is a static member of a class that is deliberately never disposed, as we want the connection to exist for the lifetime of the app. The idea, essentially, is to keep track of who is using the app at any one time. When the app shuts down, it calls another stored procedure to delete the record from the user_session table.
This all works well enough, but we wanted to cater for the rare (?) occasion when the app crashes, and the record in our user_session table doesn't get cleared. To do this, we have another stored procedure that checks what sessions exist in the Oracle v$session view, and if it finds a session in user_session that doesn't exist in v$session, it cleans up the record in user_session. This also seems to work pretty well.
But now, we have a new WCF service, hosted in IIS 6. It also does the same start-up logic as the WinForms app - it creates the OracleConnection and doesn't dispose of it until the service shuts down.
Yet for some reason, this service's record in v$session is disappearing. This happens fairly randomly, but quite regularly (usually after a few hours of the service running). This causes our stored procedure to clear the service's session from our user_sessions table when it shouldn't, which I'm trying to fix.
So, on to my question: Do OracleConnections eventually time out, perhaps if they are idle for too long? If so, where is this time out configured? If not, why would my session get removed from v$session?
I had thought that if the OracleConnection is not disposed of, then the session (in v$session) would hang around indefinitely (or until the process is shut down/killed). And that seems to be how things work in the WinForms app. But this hasn't been our experience in the WCF service: as I've explained, the session just disappears, despite the OracleConnection still being open. (I've tried listening to the StateChange event, in case for some reason the OracleConnection was being closed, but the event never fires, so the connection is definitely still open. We've also configured IIS to not terminate idle processes, so it's not like the service is being shut down without our knowledge.)
Thanks in advance.