0

I am facing this problem a while. Sometimes (just sometimes) i am getting ThreadAbortException in Page_PreRender of one my aspx pages. this is so odd, i get it sometimes in somedays. I am using SQLite with NHibernate in an asp.net website hosting in a shared webhost. The exception is :

System.Threading.ThreadAbortException: Thread was being aborted.
   at System.Data.SQLite.SQLite3.Step(SQLiteStatement stmt)
   at System.Data.SQLite.SQLiteDataReader.NextResult()
   at System.Data.SQLite.SQLiteDataReader..ctor(SQLiteCommand cmd, CommandBehavior behave)
   at System.Data.SQLite.SQLiteCommand.ExecuteReader(CommandBehavior behavior)
   at System.Data.SQLite.SQLiteCommand.ExecuteNonQuery()
   at NHibernate.AdoNet.AbstractBatcher.ExecuteNonQuery(IDbCommand cmd)
   at NHibernate.AdoNet.NonBatchingBatcher.AddToBatch(IExpectation expectation)
   at NHibernate.Persister.Entity.AbstractEntityPersister.Update(Object id, Object[] fields, Object[] oldFields, Object rowId, Boolean[] includeProperty, Int32 j, Object oldVersion, Object obj, SqlCommandInfo sql, ISessionImplementor session)
   at NHibernate.Persister.Entity.AbstractEntityPersister.UpdateOrInsert(Object id, Object[] fields, Object[] oldFields, Object rowId, Boolean[] includeProperty, Int32 j, Object oldVersion, Object obj, SqlCommandInfo sql, ISessionImplementor session)
   at NHibernate.Persister.Entity.AbstractEntityPersister.Update(Object id, Object[] fields, Int32[] dirtyFields, Boolean hasDirtyCollection, Object[] oldFields, Object oldVersion, Object obj, Object rowId, ISessionImplementor session)
   at NHibernate.Action.EntityUpdateAction.Execute()
   at NHibernate.Engine.ActionQueue.Execute(IExecutable executable)
   at NHibernate.Engine.ActionQueue.ExecuteActions(IList list)
   at NHibernate.Engine.ActionQueue.ExecuteActions()
   at NHibernate.Event.Default.AbstractFlushingEventListener.PerformExecutions(IEventSource session)
   at NHibernate.Event.Default.DefaultFlushEventListener.OnFlush(FlushEvent event)
   at NHibernate.Impl.SessionImpl.Flush()

do you have any idea ??

1 Answer 1

1

It's possible that your code took too long to execute (because of too much data, or because SQLite is waiting for another thread's lock on the database).
Try increasing httpRuntime's executionTimeout in the web.config.

Sign up to request clarification or add additional context in comments.

7 Comments

SQLite waiting for another thread is possible, how can i fix this issue ?
By not doing writes when other threads access the DB at the same time. Or use another database with better concurrency.
can i use some thread-sync technique to pause writes until other threads release db ? and do you know any other database light as sqlite ?
Something like ReaderWriterLock(msdn.microsoft.com/en-us/library/…). Use any database offered by your webhoster.
Thanks, I ran a test to multiple insert for more than 500 simultaneous thread in my local PC. It worked fine without any error. so i assume that write is not my problem. I think maybe something on the server Aborting the threads (something like antivirus or firewall or any third party program). Is there any way i can find out who is requesting thread.abort ? I mean Who wants this thread aborted ?
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.