Questions tagged [nhibernate]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers

Table design for user sessions: highly-frequent selecting/updating of rows, that are subsequently not often touched

I have a use-case where we are required to keep track of certain metrics within user sessions. Now, these metrics/stats update very often with each action/event that occurs (hundreds of times in ...
  • 1
1 vote
1 answer

SQL Server and NHibernate - blocking occurs between two unrelated queries (distributed transactions)

there's a problem that I'm seeking your help with... There are two simple queries: DELETE a row from a table in a databaseA SELECT a row from a table in a databaseB using hints with (updlock, rowlock)...
0 votes
0 answers

NHibernate second level cache collection hydration takes too long

I have enabled query caching and entity caching in NHibernate to store large collections of objects, needed for repetitive operations. While I have minimized the number of hits to db, the performance ...
  • 125
0 votes
1 answer

Query fails from application but runs fine in SSMS

I have a query that runs fine when executed from SSMS but when done so from the application, it fails with a (database level) exception. select ksprintid from kshistory_akt h where cast(h.serialno as ...
  • 207
30 votes
5 answers

SQL Deadlock on the same exclusively locked clustered Key (with NHibernate) on delete / insert

I have been working on this deadlock issue for quite a few days now and no matter what I do, it persists in one way or another. First, the general premise: We have Visits with VisitItems in a one to ...
  • 401
4 votes
1 answer

Performance problems with TOP and user defined functions in views

I have problem with performance of queries on simple query on view. To keep things simple, assume my view is defined as follows: CREATE VIEW [mon].[ViewDevicesWithGroups] AS SELECT Id, Name, ...
  • 113
4 votes
1 answer

Paging in SQL Server: Is an order by clause required? (currently, rows are being missed)

We have some code that pages through a SQL result. (Currently running on SQL Server 2008) We notice that when paging is done, some rows are not returned. Let me clarify this a bit: nHibernate ...
6 votes
1 answer

Which parameters was a stored procedure or command executed with?

We are using nHibernate which generates queries from .NET code. Occasionally, some queries get stuck in the sp_whoisactive list and we cannot find out why. I have a feeling that it has to do with a ...
0 votes
2 answers

Join two subquery in hql

How can I write this sql query in as hql: select count(distinct as prepaid, count(distinct as postpaid from (select * from subscriber where subscriber.ispostpaid=0) s join (select * ...
2 votes
0 answers

Does Oracle ADO.NET varchar parameter size influence query plan reuse?

I am considering to apply a fix which will generate constant parameter sizes for (n)varchar parameters. The application is based on NHibernate with the old OracleClientDriver (using Microsoft Oracle ...
  • 500
4 votes
2 answers

removal of GUIDS used for all PK's, FKs & Clustered indexes

Inherited control over a database that has this nasty config. It also has large sections of code generated by NHibernate, including the gneeration of GUIDs before they get to the db so no chance of ...
  • 2,581
3 votes
1 answer

How can I monitor a production database to see if there are table scans happening?

How can I monitor a production database to see if there are table scans happening? And what indexes might fix them... I'm told that we have adequate indexes but I can't see every code path, and we ...
  • 6,264