Tagged Questions
0
votes
0answers
10 views
Is full text search suitable for me?
I want to search in a table. All I need is:
1- to have different weight for columns. For example suppose I have a table that have id, title and description fields. Then if a keyword exists in title, ...
2
votes
1answer
45 views
Unit Testing a Data Access Layer
I know the question has been asked many many times before, but still I haven't found a good answer, and my take on the issue is slightly different.
I'm looking for a good way to unit test a Data ...
0
votes
1answer
29 views
How is Schema Export/Update is triggered when building a web app?
I am building a sample app using Fluent NHibernate and every blog post i read about Fluent NHibernate say that the code below creates a schema and updates the database for me (Drops and Creats ...
0
votes
0answers
16 views
Using Nhibernate Spatial to order results by distance, how do I add the distance to my returned collection?
so I am querying SqlServer 2008 data with a Geography Field (Point) using Nhibernate and the Nhibernate.Spatial tools like so:
var projection = SpatialProjections.Distance<MyObject>(x => ...
0
votes
1answer
35 views
Rewrite SQL to FluentNHibernate
I'am using NHibernate 3.3.1.4000 and FluentNHibernate 1.3.0.733 with SQL Server 2012 and I need to rewrite query to IQueryOver to do this calculation on server side without stored procedure calling.
...
0
votes
2answers
70 views
Long commit results in slow performance of nHibernate
We're using nHibernate in an ASP web application with the session-per-request pattern. Some actions which the user is able to do, result in several hundreds of INSERT and UPDATE statements which takes ...
0
votes
2answers
46 views
Timestamp accuracy - gained milliseconds
If I store a System.DateTime as a timestamp in SQL using this fluent nhibernate mapping:
Map(x => x.LoggedTimeStamp).CustomType("Timestamp")
.Not.Nullable();
When I ...
0
votes
1answer
60 views
TimeOut Exception in multicriteria/future using NHibernate
I use NHibernate 3.3.3 in my ASP.NET C# application with SqlServer 2008.
DetachedCriteria _pageCriteria = CriteriaTransformer.Clone(criteria)
.SetMaxResults(maxResult)
...
0
votes
1answer
35 views
nhibernate - get few distinct row
may i know how to distinct this column in nhibernate. I'm using c# mvc, mssql.
before distinct this column, it have many redundancy value in GLCode_FK. I would like to distinct it for drop down list ...
0
votes
0answers
48 views
nHibernate Mapping - Parent/Child relationship to the same table
I have the database structure shown below
Site (Table)
Id (PK),
Name
SiteItem (Table)
Id (PK),
SiteId (FK to Site table)
ItemName,
ParentId (FK to SiteItem table)
I now need to define the correct ...
0
votes
0answers
25 views
Litle trouble with Nhibernate + Groupby
guys..
i have a litle problem here.
I need to do this query in database
SELECT
this_.NOME_CANDIDATO,
SUM(this_.QTD_VOTOS)
FROM
BIGEO.dbo.TB_ELEICAO this_
WHERE
this_.CODIGO = '1'
...
0
votes
1answer
37 views
Nhibernate should have only one work query inside session or multiple query?
I am very confusing about design pattern with Nhibernate and worried about performance, scalability.
should we put one query inside Nhibernate session or multiple query both select and insert inside ...
0
votes
1answer
40 views
Tinyint as byte nhibernate
I have a table with a tinyint column in a SQL Server 2008 R2 database, which maps to a byte property in my POCO.
The problem is whenever I run a query with a where clause on the tinyint column using ...
1
vote
0answers
105 views
NHibernate select Top 1 / Max from groups
My entity contains the following:
Class Entity
{
Guid GroupId;
DateTime StartTime;
String Name;
String Type;
}
I need to get all records that their GroupIds in specific input list, ...
1
vote
2answers
176 views
Profiling and output caching in ASP.NET MVC
So I was recently hired by a big department of a Fortune 50 company, straight out of college. I'll be supporting a brand new ASP.NET MVC app - over a million lines of code written by contractors over ...
1
vote
2answers
41 views
Hypothetical: storing date-time data with varying specificity in SQL Server for .NET MVC app
I've got five .NET classes and corresponding SQL Server tables, each with a start and and end date, and I may have to store the dates with varying degrees of specificity, e.g., 2005, 04/2005, or ...
0
votes
0answers
199 views
SQL Server deadlock under NHibernate
I have a multithread application, that works with large database (file size >1 Gb, database has 38 tables, more than 500 K of entities per table). It uses Castle 3.1.0.0, NHibernate 3.3.1.4000, ...
0
votes
2answers
236 views
Efficient way to transfer many binary files into SQL Server database
We have a requirement for a Winforms app to read thousands of files from a local filesystem (or a network location) and store them in a database.
I am wondering what would be the most efficient way ...
0
votes
0answers
49 views
Is it possible to mix scalars and entities in a single native query
I'm wondering whether what I'm wanting to do can be achieved through appropriate mangling on NHibernate's Native SQL facilities, or whether I have to drop down to ADO.Net
I have a query that looks a ...
0
votes
1answer
170 views
Store Dependency Graph in SQL Server and create corresponding Graph Object in NHibernate/C#
I basically have 4 days to get something at its basic level working meaning get a graph network object created in NHibernate. Nothing perfect but just something that can be searched via an HNibernate ...
1
vote
1answer
71 views
NHibernate generate DB script not referencing column when adding a constraint
I have an nhibernate xml class (called class1) with the following property:
<many-to-one name="Rank" class="RankColourScheme" column="Rank_"
property-ref="Rank" not-null="true" fetch="join"/>
...
3
votes
1answer
266 views
Caching SessionFactory and Configuration for multiple databases with NHibernate
Some questions here in StackOverflow about NHibernate and multiple databases (dynamically connected), address me to believe that the best solution would be to keep a cache of SessionFactory (per ...
1
vote
3answers
122 views
using reserved word as entity name
I'm using NHibernate mapping by code with naming conventions to map my entities. Now I have following error
SQL error - Incorrect syntax near the keyword 'User'.:
I know this is reserved word and ...
2
votes
2answers
118 views
How can I add a new route on my existing asp.net-mvc site without a large rewrite?
I have an asp.net-MVC website with a SQL server backend. There are a 100 different tables and this site works for an organization of 300 people.
We now want to use it for another organization and ...
0
votes
0answers
44 views
is it feasible to use nhibernate sharding on geographically distant databases?
I need to store data in different geographically distant data bases due to regulatory requirements.
Using NHibernate Sharding looks like a solution that can do the job for me. How ever i am concerned ...
1
vote
1answer
403 views
Why does NHibernate Session.Save locks the database?
I've built a small ASP.NET MVC web app with NHibernate as ORM. On every HTTP request beginning I create a session and open a transaction and close it at the end of the request.
// Begin request
...
1
vote
1answer
72 views
Handle Open Square Bracket in NHibernate query for SQL Server
I have the following query code using NHibernate query in C#.
IQuery query = session.CreateQuery(String.Format(@"
select
r
from
...
1
vote
2answers
353 views
sp_executesql not using index?
I'm using nHibnerate in my web application and I have a problem using indexes in generated sp_execute. My table has 210 millions records and the query is very slow.
Firstly, there was a problem with ...
0
votes
1answer
286 views
Select alias property from a detached Criteria with NHibernate
I am basically trying to create this sql query in criteria. The sql query is pretty easy, but to do this with a criteria query i have to select a property from a detached criteria. Any help would be ...
1
vote
1answer
99 views
nHibernate not bubbling error
I'm sure this was working and has now stopped and I can't work out why. My classes are too complex to post, but I made a simple class to test and it's still happening.
I created a class "abc" which ...
0
votes
3answers
98 views
How to keep track of revisions?
I am trying to design my database and I want to have the ability to keep a track of history of changes.
I will have a table that will have all the nutritional facts of an food. When a user makes ...
1
vote
1answer
109 views
SQL Index: Increases performance when added manually, but scripted does not
Using MSSQL and MSSQL Server Management Studio, I have a fairly complex query with some joins and a couple of SubQueries.
One property that is selected is a decimal(19,5) named Duration. When using ...
-1
votes
1answer
104 views
Which is the better database choice when using nhibernate - MySQL or SQL Server [closed]
In a project that going to use NHibernate, Which database you guys recommend most to be use MySQL or SQL Server and Why?
Because, I'm starting a project and when I saw the prices of a hosting with ...
1
vote
2answers
327 views
using nhibernate t-sql table-valued user-defined functions
Is it possible to use table t-sql table-valued user-defined function as part of HQL query ?
here Nhibernate filtering by user defined function output is a example how to create custom dialect ...
0
votes
1answer
330 views
A network-related or instance-specific error occurred while establishing a connection to SQL Server
I am using NHibernate, Persistence API annd MYSql DB for my ASP.NET web application; and I have the following nhibernate mapping file:
<?xml version="1.0" encoding="UTF-8"?>
<persistence ...
1
vote
1answer
73 views
Update uses previously autogenerated ID on Oracle
We're having a strange problem in Oracle. I'll sketch some (simplified) context first:
Consider this mapping to an Entity:
public EntityMap()
{
Table("EntityTable");
Id(x => x.Id)
...
0
votes
1answer
59 views
Using Session.Flush then ITransaction.Commit makes data rollback
I'm trying to update an entity using Session.Update then continue to execute another SQL query. The other query did not see the changed value. When i traced it using profiler, Session.Update did ...
0
votes
1answer
73 views
Nhibernate passing in Castle.Proxies.UserProxy for positional parameter?
I know I'm loosing my mind. I've done something and now when my app is accessing the db I get an error "could not execute query ... blah blah blah"
An inner message says "Timeout expired. The ...
0
votes
1answer
125 views
Transparent deletion of joining rows via NHibernate mappings when saving a delete
I have a domain structure comprising a Policy object (a life insurance policy) which has a collection of Owners and Lives (lives to be insured) on it. They are related by a joining table we’ll call ...
0
votes
1answer
185 views
Automatically truncating strings in Fluent NHibernate
First of all, I read this article, this one and this one, but I still have a question. So I need a concrete C# solution that solve problem of truncating using any of this solutions: IUserType, ...
1
vote
0answers
169 views
NHibernate returing Incorrect Syntax Near '?'
I'm getting the error "Incorrect syntax near '?'" when I am using Hibernate.
My code is as follows:
criteria.Add(Restrictions.InG("OrgUnit", orgUnits));
criteria.SetProjection(
...
0
votes
1answer
101 views
NHibernate Transactions: Is the INSERT-UPDATE_DELETE order for a batch documented somewhere?
Preface: This question is a derivative of this answer, speaking specifically about NHibernate instead of Hibernate.
As to Hibernate, javadoc to ...
0
votes
1answer
56 views
Programmatic option to save data for restore later
I manage an ecommerce site that is built on ASP.NET with NHibernate and Castle ActiveRecord using SQL Server 2008R2 with about 100k products. Products have a normal price and a sale price. the client ...
0
votes
0answers
240 views
WCF calls timeout for no apparent reason
I am working on a piece of internal software that contains a database service which is used to provide access to a SQL Server database located locally on the same server that the database service is ...
1
vote
0answers
269 views
How to query for data containing square brackets when using NHibernate.Linq Query<T>
Some records in my database contain square brackets, eg.
dafalgan [1gram]
valium [15mg]
...
However when I want to query this with NHibernate.Linq using the following expression
return x => ...
0
votes
1answer
246 views
Relationships fixup in EntityFramework vs NHibernate
I have been experimenting with Entity Framework 4.4, NHibernate 3.3.1.4000 and SQL Server and I have noticed a difference when it comes to fixing up the relationships when you commit your changes, ...
1
vote
1answer
102 views
combining sql server spatial and NHibernate with CreateSqlQuery
I have not mapped geography table in sql server 2008, and I want to query it with a polygon instance in c# using nhibernate.
In the beggining I was trying to use sql server spatial directly but ...
0
votes
2answers
180 views
Caching Common Table Expressions (CTE) queries in NHibernate
I have a table holding hierarchical data that I am querying for from my web app using NHibernate. It's pretty straight forward
CREATE TABLE [dbo].[Relationships](
[RelationshipId] ...
1
vote
1answer
91 views
Taking the Top X results of a complex NHibernate query (QueryOver syntax)
I'm working with an Nhibernate Query where I have to do some complex queryover join aliases to eagerly load the children of my root entity. When loading, I want to filter the root entity results ...
0
votes
1answer
78 views
nhibernate joins with no relationship between tables
tableA
------
Aprimarykey,
Afield1,
Afield2,
AfieldtoMatch
tableB
------
Bprimarykey,
Bfield1,
Bfield2,
BfieldtoMatch
There is no relationship between tables. What would be the classes and the ...