c# - Unhandled exception while doing SqlBulkCopy -


i have configured console application in task scheduler.

the console application uses sqlbulkcopy insert data sql table reading same csv file.

the problem job randomly throws exception not able catch using try catch.

however gets logged event viewer as:

application: applicationname.exe framework version: v4.0.30319 description: process terminated due unhandled exception. exception info:  system.data.entity.infrastructure.dbupdateexception stack:    @ system.data.entity.internal.internalcontext.savechanges()    @ system.data.entity.internal.lazyinternalcontext.savechanges()    @ system.data.entity.dbcontext.savechanges()    @ sdo.repository.repository`1[[system.__canon, mscorlib, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089]].savechanges()    @ sdo.business.solutiondb.solverprocess.processconsoleoutput(system.object, system.diagnostics.datareceivedeventargs)    @ system.diagnostics.process.outputreadnotifyuser(system.string)    @ system.diagnostics.asyncstreamreader.flushmessagequeue()    @ system.diagnostics.asyncstreamreader.readbuffer(system.iasyncresult)    @ system.io.stream+readwritetask.invokeasynccallback(system.object)    @ system.threading.executioncontext.runinternal(system.threading.executioncontext, system.threading.contextcallback, system.object, boolean)    @ system.threading.executioncontext.run(system.threading.executioncontext, system.threading.contextcallback, system.object, boolean)    @ system.io.stream+readwritetask.system.threading.tasks.itaskcompletionaction.invoke(system.threading.tasks.task)    @ system.threading.tasks.task.finishcontinuations()    @ system.threading.tasks.task.finishstagethree()    @ system.threading.tasks.task.finishstagetwo()    @ system.threading.tasks.task.finish(boolean)    @ system.threading.tasks.task.executewiththreadlocal(system.threading.tasks.task byref)    @ system.threading.tasks.task.executeentry(boolean)    @ system.threading.tasks.task.system.threading.ithreadpoolworkitem.executeworkitem()    @ system.threading.threadpoolworkqueue.dispatch()    @ system.threading._threadpoolwaitcallback.performwaitcallback() 

the task scheduler job stuck @ point. fyi using entity framework 6 database first approach. insert more 30k of data in 1 table went sqlbulkcopy approach , performing quite good. issue facing.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

android - IBM Worklight 6.1 [Application Error] There was a network error (file:///android_asset/www/index.html) -