S
Shyamalan Chemmery via DotNetMonster.com
I'm currently using .NET 1.0 and MS .NET provider for Oracle to connect to
my Oracle9i R2(9.2.0.5) database.
I have a piece of code which in essence is as given below
Try
m_Conn = New OracleConnection(strDBConnString)
m_Conn.Open()
m_Trans = m_Conn.BeginTransaction()
'Here I have a series of inserts and updates on huge tables. I am using
ExecuteNonQuery function of the OracleCommand object for all these
operations.
InsertTb1()
InsertTb2()
UpdateTb3()
'If all goes fine I commit the whole transaction
m_Trans.Commit()
Catch ex as Exception
'Here I catch all exceptions and rollback the whole transaction
m_Trans.Rollback()
Finally
m_Conn.Close()
End Try
I have similar code doing different actions on the same tables, running
through out the application. Off late I have been getting database locks
and subsequent slowness in the application. My DBA tracks down the holding
statements and kills the session.
Now, if the script used in InsertTb1() happens to be the statement of the
assocated session that was killed, I expect Oracle to throw an exception,
which inturn should be caught in the catch block and the whole transaction
shoud be rolled back. But, it looks like I do not get an exception, due to
which the code proceeds to fire the subsequent statements (InsertTb2(),
UpdateTb3()) and I end up with incomplete records in the database.
I have had an instance before, where Oracle database was throwing a 'No
Data found' exception, but the exception never bubbled to my code i.e. The
..NET provider ignored the excepton. Could this be a similar case?
my Oracle9i R2(9.2.0.5) database.
I have a piece of code which in essence is as given below
Try
m_Conn = New OracleConnection(strDBConnString)
m_Conn.Open()
m_Trans = m_Conn.BeginTransaction()
'Here I have a series of inserts and updates on huge tables. I am using
ExecuteNonQuery function of the OracleCommand object for all these
operations.
InsertTb1()
InsertTb2()
UpdateTb3()
'If all goes fine I commit the whole transaction
m_Trans.Commit()
Catch ex as Exception
'Here I catch all exceptions and rollback the whole transaction
m_Trans.Rollback()
Finally
m_Conn.Close()
End Try
I have similar code doing different actions on the same tables, running
through out the application. Off late I have been getting database locks
and subsequent slowness in the application. My DBA tracks down the holding
statements and kills the session.
Now, if the script used in InsertTb1() happens to be the statement of the
assocated session that was killed, I expect Oracle to throw an exception,
which inturn should be caught in the catch block and the whole transaction
shoud be rolled back. But, it looks like I do not get an exception, due to
which the code proceeds to fire the subsequent statements (InsertTb2(),
UpdateTb3()) and I end up with incomplete records in the database.
I have had an instance before, where Oracle database was throwing a 'No
Data found' exception, but the exception never bubbled to my code i.e. The
..NET provider ignored the excepton. Could this be a similar case?