O
Olivier BESSON
Hello,
I resend the same question i previously sent because i did'nt used the good
reply-to address.
I'm having a ThreadAbortException and i don't know why.
When i launch the same code sometimes it never crash a the same place but
always in the proc. you find below.
If it can help, i'm using Nant and i launch the code with "Test with
debugger".
My base code is reading files on disk and making a lot of insert and update
queries on the server. I'm the only user of the database.
This is the code :
Public Shared Function QueryDataSetWithNoExceptionCode(ByVal SQLQuery As
String) As DataSet
Try
Dim sConnectionString As String = _GetConnectionString()
Dim conDB As New SqlConnection(sConnectionString & ";connect
timeout = 60")
Dim cmdQuery As New SqlCommand(SQLQuery, conDB)
cmdQuery.CommandTimeout = 300
Dim da As New SqlDataAdapter(cmdQuery)
Dim ds As New DataSet
da.Fill(ds)
cmdQuery = Nothing
conDB = Nothing
da = Nothing
Return ds
Catch ex As Exception
Throw ex
End Try
End Function
When the breakpoint is on the catch i have this :
?ex.ToString
"System.Threading.ThreadAbortException: Le thread a été abandonné.
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
behavior)
at
System.Data.SqlClient.SqlCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior
behavior)
at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
at
Corus.FortisDocumentService.FortisDocumentService.Metier.CorusFortisDataAccess.QueryDataSetWithNoExceptionCode(String
SQLQuery) in
C:\DATAS\Dvpt\Sources\Clients\Fortis\FortisDocumentService\Trunk\src\FortisDocumentService.Metier\CorusFortisDataAccess.vb:line
55"
I resend the same question i previously sent because i did'nt used the good
reply-to address.
I'm having a ThreadAbortException and i don't know why.
When i launch the same code sometimes it never crash a the same place but
always in the proc. you find below.
If it can help, i'm using Nant and i launch the code with "Test with
debugger".
My base code is reading files on disk and making a lot of insert and update
queries on the server. I'm the only user of the database.
This is the code :
Public Shared Function QueryDataSetWithNoExceptionCode(ByVal SQLQuery As
String) As DataSet
Try
Dim sConnectionString As String = _GetConnectionString()
Dim conDB As New SqlConnection(sConnectionString & ";connect
timeout = 60")
Dim cmdQuery As New SqlCommand(SQLQuery, conDB)
cmdQuery.CommandTimeout = 300
Dim da As New SqlDataAdapter(cmdQuery)
Dim ds As New DataSet
da.Fill(ds)
cmdQuery = Nothing
conDB = Nothing
da = Nothing
Return ds
Catch ex As Exception
Throw ex
End Try
End Function
When the breakpoint is on the catch i have this :
?ex.ToString
"System.Threading.ThreadAbortException: Le thread a été abandonné.
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
behavior)
at
System.Data.SqlClient.SqlCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior
behavior)
at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
at
Corus.FortisDocumentService.FortisDocumentService.Metier.CorusFortisDataAccess.QueryDataSetWithNoExceptionCode(String
SQLQuery) in
C:\DATAS\Dvpt\Sources\Clients\Fortis\FortisDocumentService\Trunk\src\FortisDocumentService.Metier\CorusFortisDataAccess.vb:line
55"