Invalid Logoff Trigger causes unhandled OracleException
Posted: Tue 26 Jun 2007 19:45
I am getting an unhandled CoreLab OracleException that is causing my application to crash. It is easily reproducible and I've provided some source code below.
The scenario is that the Oracle database has an invalid trigger associated to the Logoff event. Although there are compilation errors, they are treated as warnings and will allow the trigger to be executed.
It's expected that when the application closes the database connection, the trigger will be fired, and the application can continue on with it's processing. However, what is happening is after a certain amount of time (approximately 5 minutes) a Microsoft dialog box pops up stating that an unhandled exception occurred and will need to shut down the application.
Debugging revealed the following stack trace:
Here are the steps to reproduce
1) create a trigger with the following body:
2) create a C# application that opens and closes an OracleConnection associated to the same schema that the trigger is associated too. The key thing to remember here is to keep the form open after you press the button. It's not necessary to do anything else just let it sit there after you cause the connection to close. If you dispose of the form then the CoreLab objects are disposed and the exception is not created. However, leaving the form open for approximately 5 minutes (i've timed this several times) then the error will occur. I will attach a test project if necessary.
It appears that the CoreLab calls a thread to perform the disconnect and doesn't handle the exception that is thrown by the invalid trigger.
I'm using the following:
OraDirect .Net 3.20.7.0
Oracle 10g Standard Edition
Microsoft Framework .Net 2.0
Windows XP Professional SP2
The scenario is that the Oracle database has an invalid trigger associated to the Logoff event. Although there are compilation errors, they are treated as warnings and will allow the trigger to be executed.
It's expected that when the application closes the database connection, the trigger will be fired, and the application can continue on with it's processing. However, what is happening is after a certain amount of time (approximately 5 minutes) a Microsoft dialog box pops up stating that an unhandled exception occurred and will need to shut down the application.
Debugging revealed the following stack trace:
Code: Select all
at a.a.b.b()
at CoreLab.Oracle.OracleInternalConnection.a(Boolean A_0)
at CoreLab.Common.DbConnectionPoolGroup.b(Object A_0)
at CoreLab.Common.DbConnectionPool.RemoveObject(Object connection)
at CoreLab.Common.DbConnectionPoolGroup.a(DbConnectionPool A_0)
at CoreLab.Common.DbConnectionPoolGroup.a(Object A_0)
at System.Threading._TimerCallback.TimerCallback_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading._TimerCallback.PerformTimerCallback(Object state)
1) create a trigger with the following body:
Code: Select all
create or replace TRIGGER TRIGGER1
BEFORE LOGOFF ON DATABASE
BEGIN
This_proc_doesnt_exist;
END;
It appears that the CoreLab calls a thread to perform the disconnect and doesn't handle the exception that is thrown by the invalid trigger.
I'm using the following:
OraDirect .Net 3.20.7.0
Oracle 10g Standard Edition
Microsoft Framework .Net 2.0
Windows XP Professional SP2