My I have a sample if you don't mind?
For 3 session factories.
On Mar 6, 7:53 pm, Fabio Maulo wrote:
> catalog = each class mapping may have its catalog
> 3 ms access = Access is not a RDBMS, 3 xyz.cfg.xml with 3 session factories.
>
> 2009/3/6 nobodybutca
>
>
>
>
>
> > Anyone?
>
> > On Mar 5,
The irony here is that I'm using Merge to try and recover from a
StaleObjectStateException!
I'm using of r4098 from the NHibernate trunk.
Here's the test case:
[Test]
public void Should_be_able_to_merge_stale_object()
{
var obj = new Location { Address = new Address("1", "1", "1",
"1") };
Try to create a failing NUnit test and create a new issue (improvement) in
our JIRA.Thanks.
2009/3/9 Germán Schuager
> Fabio, I've made up the Cat class only to show my point: session.Merge is
> accessing properties of instances in invalid state when it is not needed.
>
> I do have the real use-
Fabio, I've made up the Cat class only to show my point: session.Merge is
accessing properties of instances in invalid state when it is not needed.
I do have the real use-case and I assure you that it makes a lot more sense
than the cat ;) only that it is very complex to present it here...
The so
Ah... German... try to recreate the situation out-side the code of the
application; I'm sure you will find the solution or at least you can send us
a real use-case with a real class and a real mapping.
2009/3/9 Fabio Maulo
> so.. in a property getter you are accessing to a Relationship loaded us
Hi, I'm using NHibernate with part of the Active Record implementation
for the actual configuration.
I'm experiencing some performance-issues when NHibernate populates my
entities, and I'm wondering if these numbers are to be expected?
I have e query, generating approx 700 rows (larger than it u
To know if it is normal try to do the same using a DataReader and instancing
your entities.
2009/3/9 Jimmy Shimizu
>
> Hi, I'm using NHibernate with part of the Active Record implementation
> for the actual configuration.
>
> I'm experiencing some performance-issues when NHibernate populates my
so.. in a property getter you are accessing to a Relationship loaded using
lazy-loading, inside the same class... and all to have a unnormalized
property.interesting and discouraged approach.
Inside the getter you should check if "state" is a proxy and in that case
you should initialize it (the dy
Are these databases reside in one server or in multiple servers?
If it's one server following is the solution
http://mikehadlow.blogspot.com/2008/10/mapping-entities-to-multiple-databases.html
-
Sathish
On Thu, Mar 5, 2009 at 12:48 PM, graphicsxp wrote:
>
> Hi,
>
> I've got two business entit
Hi all:
This is a newbie question, so please bear with me.
I have the following tables (simpify version).
CITY:
city (varchar2) (PK)
province (varchar2) (PK)
CITY_TL:
city (varchar2) (PK)
province (varchar2) (PK)
lang (char (2)) (PK)
LOCATION:
location (varchar2) (PK)
some other column.
As y
My actual model is somewhat more complex than this:
public interface INum
{
int Num { get; }
}
public class Cat : Entity, INum
{
private State state;
protected Cat() { }
public Cat(State state)
{
this.state = state;
}
public virtual State State { get { return state;
Mapping please.
2009/3/9 Germán Schuager
> inline
>
> On Mon, Mar 9, 2009 at 5:11 PM, Fabio Maulo wrote:
>
>> The fact is that the Merge need to read the state from DB but with its
>> result in the persistent class (not from DataReader).
>
>
> I think that I understand. That is the case of merg
inline
On Mon, Mar 9, 2009 at 5:11 PM, Fabio Maulo wrote:
> The fact is that the Merge need to read the state from DB but with its
> result in the persistent class (not from DataReader).
I think that I understand. That is the case of merging a detached entity,
but when merging a new transient
The fact is that the Merge need to read the state from DB but with its
result in the persistent class (not from DataReader).BTW I don't understand
how you can work with that entity... NH use the parameterless ctor not only
for Merge but even when you use session.Get(id).
In case of Get/Load who are
Thanks Fabio, I will take a look at what a tuplizer is :), but I don't see
why NH needs to access the properties of a newly created object just to
overwrite them with the transient instance properties' values.
I'm browsing the NH source to trying to find out but it is complex beast...
It seems th
NHibernate only talks to one database.
-Ryan Rinaldi
blog: http://ryanrinaldi.com
On Mon, Mar 9, 2009 at 10:20 AM, graphicsxp wrote:
>
> Linked servers ? I'm not sure what this is. Is there not a "simple"
> way through configuring the mapping files ?
>
> On 5 mar, 18:05, Tuna Toksoz wrote:
> >
Ah.. sorry.. in Merge sure it access to the getter... sorryIf you need a
certain ctor you should implement your own tuplizer (I don't know where you
will find the State instance but it is another matter).
2009/3/9 Germán Schuager
> I've tried it. It does access the getters when merging an entit
I've tried it. It does access the getters when merging an entity in the
method CopyValues of DefaultMergeEventListener.cs
https://nhibernate.svn.sourceforge.net/svnroot/nhibernate/trunk/nhibernate/src/NHibernate/Event/Default/DefaultMergeEventListener.cs
On Mon, Mar 9, 2009 at 3:14 PM, Fabio Maul
NH don't access to the getter during object creation. Try it.
2009/3/9 Germán Schuager
> Hi Fabio,
>
> Num is a persistent property, and I have several entities that implement
> INum; in this case Cat is delegating its actual implementation to its
> private field "state".
>
> I don't think that
Hi Fabio,
Num is a persistent property, and I have several entities that implement
INum; in this case Cat is delegating its actual implementation to its
private field "state".
I don't think that a nosetter access for Num would solve the problem because
the exception would be generated anyway (whe
Thanks for the explanation, greatly appreciated.
That makes sense.
I'm still learning...
On 9 mar, 17:23, Jay Chapman wrote:
> The answer to that question is that you don't. Think of NHibernate as a
> synchronization tool, not a database persistence tool. It's trying to make
> it so that the
The answer to that question is that you don't. Think of NHibernate as a
synchronization tool, not a database persistence tool. It's trying to make
it so that the database is a form of "extended memory". You want both the
Person assigned to the Car and the Car added to the person's collection whe
If Num is a persistent property you should use- a field only to make NH
happy (you don't need to use it)
- Num access="nosetter.camelcase"... if I well remember we have another
accessor in NH2.1 access="read-only"
2009/3/9 Germán Schuager
> Hi,
>
> I want to do a merge of a transient object whic
Thanks Jay,
So basically you are saying that what I do is correct, but your
solution is a shortcut as you are assigning the Person entity to the
Car entity within the Add() method.
Fair enough, but my initial question was, how can I do it without
having to specify the Person entity, i.e have the
ok i got it you mean adding the Car entity to my collection of cars in
Person. :)
But that's exactly what I do already :
myPerson.cars.add(new Car(1, myPerson))
myPerson.cars.add(new Car(2, myPerson))
sorry I should have included this code in my first post.
Yet I still get the problem.
O
cars.Add(car)
car.Person = this;
On Mon, Mar 9, 2009 at 12:22 PM, graphicsxp wrote:
>
> Hi Roger,
> can you explain ? what's in AddCar ?
>
> On 9 mar, 15:56, Roger Kratz wrote:
> > myPerson.AddCar(myCar)
> >
> > -Original Message-
> > From: nhusers@googlegroups.com [mailto:nhus...@googl
Hi Roger,
can you explain ? what's in AddCar ?
On 9 mar, 15:56, Roger Kratz wrote:
> myPerson.AddCar(myCar)
>
> -Original Message-
> From: nhusers@googlegroups.com [mailto:nhus...@googlegroups.com] On Behalf Of
> graphicsxp
> Sent: den 9 mars 2009 16:52
> To: nhusers
> Subject: [nhuser
Linked servers ? I'm not sure what this is. Is there not a "simple"
way through configuring the mapping files ?
On 5 mar, 18:05, Tuna Toksoz wrote:
> Or may not.
>
> Tuna
> Toksözhttp://tunatoksoz.comhttp://turkiyealt.nethttp://twitter.com/tehlike
>
> Typos included to enhance the readers atten
myPerson.AddCar(myCar)
-Original Message-
From: nhusers@googlegroups.com [mailto:nhus...@googlegroups.com] On Behalf Of
graphicsxp
Sent: den 9 mars 2009 16:52
To: nhusers
Subject: [nhusers] issue with bi-directional one-to-many association when saving
Hello,
I have a question about bi
Hello,
I have a question about bidirectional one-to-many associations. Let's
consider we have a class Person which can hold a collection of
entities of type Car.
My mapping file for Car would have something like :
and my mapping file for Person would contain :
Now that i
the unique-key does create a unique index but, like the primary key,
there seems to be no way to specify a name for it.
My assumption was that the value of the unique-key attribute would
also be the name of the generated index,
but this results in a unique index on called U
Hi,
I want to do a merge of a transient object which some of its properties are
assigned with detached objects, in order to get a persistent object with all
its properties assigned with persistent instances (using cascade="merge").
Is this the correct usage scenario for merge?
Here is a sample en
Don't know about 2, but I'm pretty sure with 1 you either live with it or
make it bidirectional.
On Mon, Mar 9, 2009 at 2:39 PM, Mario Hallmann <
mario.hallm...@googlemail.com> wrote:
>
> Hi,
>
> from an extracted sample application i get the following sql output
> which is not as i would like it
Hi,
from an extracted sample application i get the following sql output
which is not as i would like it to be:
1. session:
NHibernate: INSERT INTO [MyAssociatedObject] DEFAULT VALUES; select
SCOPE_IDENTITY()
NHibernate: INSERT INTO [MyObject] DEFAULT VALUES; select
SCOPE_IDENTITY()
NHibernate:
And this :
Hibernate Exception: Illegal attempt to associate a collection with
two open sessions
> I receive this error :
> could not delete collection:
> [Com.SIT.Base.Business.Product.MyAssembly#18][SQL: SQL not available]
--~--~-~--~~~---~--~~
You
Hello there,
I have 2 tables "OrderDetails" and "Product" with a one-to-many relation.
Since I added this relation, I just see the problem now, ...
impossible to delete a product even if this product is not used in
OrderDetail.
The query executed is
UPDATE [Product]
SET[ProductId] = null
WH
I believe you're looking for unique-key, not index. As for the primary key,
I don't think you can set the name of the constraint it generates.
On Mon, Mar 9, 2009 at 11:40 AM, bzurer wrote:
>
> Given this mapping a unique index is created in the database on the
> Name column.
>
>
>
>
>
Given this mapping a unique index is created in the database on the
Name column.
I would like to specify the name of the index that NHibernate
generates when the unique attribute is set to true.
Setting the attribute index="MyIndexName" creates an index with that
name but it is not u
You are using something to generate the mapping.In the class or in the HQL
there is something wrong.
Check the type of this two properties:
TimeFinished
TimeMainlineDuration
Ensure you are using query.SetDateTime("parameterName", value).
P.S. The query you sent us is not related to the mapping you
This issue is also related to http://nhjira.koah.net/browse/NH-1654
The specific dialects need to register their reserved keywords.
1654 fixed this for the TOP keyword in MSSql dialects.
On Mar 7, 12:46 am, robcar wrote:
> It seems that this is a confirmed bughttp://jira.nhibernate.org/brows
Thanks, it did! :-)
On 7 Mar, 07:38, Tuna Toksoz wrote:
> This should help
>
> http://nhforge.org/blogs/nhibernate/archive/2008/09/06/prepare-your-s...
>
> Tuna
> Toksözhttp://tunatoksoz.comhttp://turkiyealt.nethttp://twitter.com/tehlike
>
> Typos included to enhance the readers attention!
>
>
Hello,
i have the following problem:
When i want to get objects between a special date i get the error,
that nhibernate could not execute query with the ORA-01830: date
format picture ends before converting entire input string.
When i copy the generated SQL string into SQL developer and excecut
42 matches
Mail list logo