I'm using Castle ActiveRecord as my ORM in my ASP.NET webapplication. I'm using their SessionPerRequest-approach and this works fine. However, if an error occures on the database-level (f.e. a constraint error when deleting an item or a truncation error (String or binary data would be truncated.)) I keep getting timeouts with all queries I run after the error. This happends for about ten minutes, then everything runs fine again. I think this has to do with the Transaction not closing correctly. I can't seem to find a way to correctly close the transaction after an error, so I'm looking now to minimize the effects. I've tried setting the Command Timeout and Connection Timeout to a smaller number, but this does not seem to work. Does anybody got an idea how to solve this problem?
SQL Timeout after database exceptions
234 Views Asked by Pbirkoff At
1
There are 1 best solutions below
Related Questions in SQL-SERVER
- Dynamic query creation with Array like implementation
- 'pyodbc.Cursor' object has no attribute 'callproc', mssql with django
- Driver com.microsoft.sqlserver.jdbc.SQLServerDriver claims to not accept jdbcUrl, ${SPRING_DATASOURCE_URL}: GitHub Actions
- PHP Laravel SQLServer could not find driver
- Upsert huge amount of data by EFCore.BulkExtensions
- How to locate relevant tables or columns in a SQL Server database
- Cannot delete SQL datafile (.mdf) as its currently in use
- Writing query in CTE returning the wrong output
- Group By Sum and without Group by sum Amount is different
- plan_handle is always different for each query in SQL Server Cache
- Adding a different string to a table fails
- The specified data type in the EF modelBuilder doesn't correspond to the one that is created
- SQL71561: SqlComputedColumn: When column selected
- How to Solve Error Associated with Trusted Authority
- SQL Server Data Model and Insert Performance
Related Questions in ASP.NET-MVC
- I have a problem outputing the roles on the page ListRoles.cshtml
- Dropdown list showing SQLServer2005SQLBrowserUser$DONSERVER instead of Active Directory group name in ASP.NET MVC C#
- Hosting ASP.NET MVC application on IIS web server using Windows 2019 server
- How to display only department fields associated with a selected department in student automation system?
- How to send select input data for form submission?
- Multi level project reference using dll
- How to upload file to Onedrive using ASP.NET MVC?
- ASP.NET MVC web app looping between fields only on some devices
- Is there any automatic job to load AD-groups?
- How to restrict admin js files to download
- Download PDF in ASP.NET MVC application
- How to add bootstrap theme/example into ASP.NET MVC 5?
- Web API works with Windows authentication enabled when consumed via Swagger but throws an unauthorized issue when accessed through web app
- ASP.Net Core 7.0 Web App (Model-View-Controller) ErrorViewModel OnGet OnPost do not get called or executed
- OAuth 2.0 keep getting Authorization has been denied for this request
Related Questions in NHIBERNATE
- Possible to get nested proxies of hierarchical data in one query using NHibernate?
- ISession.Load(id) "Creating a proxy instance failed" "Sequence contains more than one matching element"
- RedundantArgumentMatcherException in azure pipeline when field is used and not when using local variable
- Specify entity / SQL insertion order in NHibernate transaction without multiple flushes
- NHibernate: Entities Mapped Incorrectly Despite Correct Configuration
- How to get all objects with parameters of other tables in NHibernate?
- Which version of Nhibernate works with .NET 6 & Visual Studio 2022?
- Writing NetTopologysuite Point geometry to PostgreSQL with fluent nhibernate fails due to custom type mapping
- nHibernate: SessionFactory.Evict(type) not working as expected
- Nhibernate - eager fetching collections in collections with linq
- NHibernate new version upgrade
- How to reference both entities when having only one column in one table in Fluent Nhibernate?
- ORA-22835: Insufficient buffer size for converting CLOB to CHAR or BLOB to RAW (actual: 81863, maximum: 2000)
- NHibernate to return records, that contain a value in the List<string>
- Select items from a group by where count is larger than 1
Related Questions in CASTLE-ACTIVERECORD
- Why does my parallel.ForEach method return the wrong values?
- Castle ActiveProject retrieving stale data from FindAllByProperty
- SQL Timeout after database exceptions
- Castle ActiveRecord, C# - Improving performance of ActiveRecordMediator.FindAll method through reducing executed queries
- Merge Detached Object Graph in NHibernate
- What is the flow of nhibernate Pure?
- Castle.ActiveRecord - Could not compile the mapping document: (string)
- NHibernate with Castle, HQL could not locate parameter [param]
- Unexplained Castle and MTM errors
- Castle ActiveRecord mapping a view
- Resources Files in Multiple Languages
- Auto mapper is failing to map a Castle Active Record Proxy to multiple destination types
- How to stop Automapper from mapping to parent class when child class was requested
- Castle ActiveRecord not connecting to the database
- Castle Windsor / ActiveRecord / NHibernate: How to intercept/modify connection string
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
as far as I can understand your Situation, there are two possible sources for your problem:
1. Data-Base-Server-Configuration You haven't tould us wich database you are using, so I can only guess. If the SQL-commands causes locks they could be waiting for the old command that caused an exception and will never resolve (aka. TimeOut). If the transaction is stored in a log file, the log file might be physically full (very unlikely) and no future commands can be stored till the old command that caused an exception is resolved (aka. TimeOut). There might be - depending uppon the data base system - hundrets of other reasons fro the error. In eiter way it is easy to test and if it is caused by the data-base, then you can just start a new request with only the SQL-commands, no NHibernate and more geared to wards data-base-experts. How to test, if it is a data-base configuration problem? Simple. You just have to cause the error and then use the administrative tool (for example MS SQL Server Management Studio, Oracle SQL Developer, etc.) to send the same SQL-command as your Software is sending. If this command from the administrative tool has the same problems as your Software, then it is a data-base configuration problem and you should be able to reproduce and solve it within the database only. If the comman from the administrative tool resolves without a timeout then the problem is within the code or configuration of your software.
2. SessionPerRequest isn't working I guess that with "happens for about 10 minutes" you mean that after not using the software for 10 minutes (round about) the problem stops. I also guess that the problem will persist for longer then 10 minutes if you keep sending new requests from your browser to the server (IIS) without longer breaks. This would mean that eiter the IIS-web-session or the IIS-application-pool (both used by your software) get a timeout and are disposed what also disposes every static variable, every session variable and every NHibernate-session that is stored in there! If you want to use a SessionPerRequest solution to avoid this problem, then you have to implement a SessionPerRequest aproach for this yourself! ! You have to have code in your application that is creation a new NHibernate-session at the beginning of a request and disposing it's own NHiberante-session at the end of the request, this isn't coded into NHibernate itself and can not be activated with any configuration, you have to code it yourself.
Greetings Juy Juka