I'm using the HiLo generator in my S#rpArchitecture/NHibernate project and I'm performing a large import batch.
I've read somewhere about the possibility to predict the Low values of any new records because they are generated on the client. I figure this means I can control the Low values myself or at least fetch the next Low value from...
I am trying to create a type of recorded data transaction that I can replay on a different database.
For example I am capturing an order into a system, when I save that I want to be able to "export" a sql script that I can run on another database to create the same order.
I am using NHibernate and I am trying to catch the sql query str...
Hi all,
I"m having some problems with Nhibernate and native sql.
I've got an entity with alot of collections and I am doing an SQL Fulltext search on it. So when returning 100 or so entities, I dont want all collections be lazy loaded. For this I changed my SQL query:
SELECT Query.*
FROM (SELECT {spr.*},
{adr.*}...
I'm hoping someone can help me with mapping a legacy database. The
problem I'm describing here has plagued others, yet I was unable to
find a real good solution around the web.
DISCLAIMER: this is a legacy DB. I have no control over the composite
keys. They suck and can't be changed no matter much you tell me they
suck. I can't add ...
I'm creating a windows forms application with NHibernate. It's an MDI application, so there is no limit to how many forms the user can have open at the same time (probably many).
For most forms I want to have an "OK" and a "Cancel" button. Both close the form, but "OK" also saves the modified data to the DB. The forms can be pretty comp...
First, we create classes that represent db entities, ok, done.
Let's say we use Hibernate session factory and JPA annotations.
Now we must create a DAO: getUserById, getAllUsers() etc.
What do you recommend about transaction management, session factory, how a good design to be made?
...
Hi
I have implemented optimistic locking for concurrency situations.
I have used the version property in the mapping files to link to a integer.
My aim is that if a user tried to save an out-of-date object, she will be given the option to overwrite changes.
I have easily managed to get the SaveOrUpdate to throw an exception, but how...
Kinda stuck here... I have an application with lets say 5000 rows of data per user and was wondering if it was right or wrong to do it this way:
On user account creation a new table is created (UserData_[UserID])
or should I just have 1 table for userdata and have everything in there with a column for userid?
The reason I am stuck at ...
I'm creating a domain model where entities often (but not always) have a member of type ActionLog.
ActionLog is a simple class which allows for an audit trail of actions being performed on an instance. Each action is recorded as an ActionLogEntry instance.
ActionLog is implemented (approximately) as follows:
public class ActionLog
{ ...
I'm trying to write a simple query that requires an alias as it's a Many-To-Many assocation however I can't get it to work with NH Lambda Extensions. It always gives me a compile error even though as far as I can tell it's exactly the same as the documentation and all the examples I've seen online.
Works
var query = DetachedCriteria.Fo...
This is the same question as: http://stackoverflow.com/questions/803872/hilo-or-identity
Let's take the database of this site as an example.
Lets say that the site has the following tables:
Posts.
Votes.
Comments.
What is the best strategy to use for it:
Identity - which is more common.
OR
HiLo - which give best performance.
...
I'm getting a the following exception:
"Timeout Expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled conections were in use and max pool size was reached."
...from a relatively heavily trafficked ASP.NET MVC 2 site I developed using StructureMap and Fluent NHiber...
So I have a set up similar to this questions:
Parent Child Setup
Everything works great when saving the parent and the children.
However, I seem to have a problem when selecting the children. I can't seem to get all the children with a specific parent.
This fails with: NHibernate.QueryException: could not resolve property: ParentEnti...
I am using ASP MVC 2 and Nhibernate. I have created an HTTP Module as demonstrated in Summer of NHibernate 13 that looks like so:
public void Init(HttpApplication context)
{
context.PreRequestHandlerExecute += new EventHandler(Application_BeginRequest);
context.PostRequestHandlerExecute += new EventHandler(Application_EndReque...
Hello,
Im doing a project with C# winforms. This project is composed by:
Client project: Windows Forms where user will call the CRUD operations;
Server project;
Common Project: This project will hold the models (in the image only have the model Item);
ListSingleton Project: Remote Object that will do the operations on the models;
...
Hi, i am using Spring.net 1.2 with NHibernate 2.0.1.
Within my project i'am facing some Deadlock issues and besides the database tweaks to minimize the occurence i would like to implement Springs RetryAdvice to handle this.
I can't find any working example how to configure a this. The reference seems to be clear about how to use it but ...
I'm trying to do a query through NHibernate where the criterion for the result depends on a referenced table. How do I do this? Let's look at a simple example:
public class Foo
{
public int Id { get; set; }
public string Name { get; set; }
public Bar ReferencedBar { get; set; }
}
public class Bar
{
public int Id ...
I've got a problem using an ISQLQuery with an AddJoin. The entity I'm trying to return is RegionalFees, which has a composite-id which includes a Province instance. (This is the the instance being improperly loaded.)
Here's the mapping:
<class name="Project.RegionalFees, Project" table="tblRegionalFees">
<composite-id name="Id"
cl...
Hi,
I've got two tables. Invoice with columns CustomerID, InvoiceDate, Value, InvoiceTypeID (CustomerID and InvoiceDate make up a composite key) and InvoiceType with InvoiceTypeID and InvoiceTypeName columns.
I know I can create my objects like:
public class Invoice
{
public virtual int CustomerID { get; set; }
public virtual ...
Hi all,
do you know anyway how I to use CONTAINSTABLEvia HQL? I need to use CONTAINSTABLE, not just CONTAINS. Currently I am using a SQL-query, but I need to use the multi-query feature which is not avaiable for SQL right now.
If there is no such thing, would I be able to extend the MSSQL dialect? Or would that require to modify the co...