| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> disconnect problem with embedded sql
hi there,
we have oracle 8.1.6 running on sun solaris server, and we make db accesses
with embedded sql (c++) from another server. everything is running quite
well, but there is a problem with destroying the sessions on the oracle:
whenever a user logs into our application, the c++ part does the following:
struct sqlca& sqlca = m_sqlca;
EXEC SQL ENABLE THREADS; EXEC SQL BEGIN DECLARE SECTION;
const char *h_database = databaseP;
const char *h_dbname = m_dbname;
const char *h_username = usernameP;
const char *h_password = passwordP;
sql_context h_ctx = m_contextP;
EXEC SQL END DECLARE SECTION;
EXEC SQL CONTEXT ALLOCATE :h_ctx;
EXEC SQL CONNECT :h_username IDENTIFIED BY :h_password AT :h_dbname USING :h_database;
whenever this session has not been used for more than two hours, we try to destroy it like that:
struct sqlca& sqlca = m_sqlca;
EXEC SQL BEGIN DECLARE SECTION;
const char *h_dbname = m_dbname;
sql_context h_ctx = m_contextP;
EXEC SQL END DECLARE SECTION;
try
EXEC SQL CONTEXT FREE :h_ctx;
EXEC SQL AT :h_dbname ROLLBACK WORK RELEASE;
}
fact is that the session is never destroyed on oracle. to solve that problem, we have a job running on oracle to doing "alter system kill session 'x,y'".
has anybody an idea, how we can get rid of those sessions from c++?
thanks Received on Fri Apr 12 2002 - 09:20:18 CDT
![]() |
![]() |