de la documentacion de NH:
5.1.4.7. Assigned Identifiers

If you want the application to assign identifiers (as opposed to having
NHibernate generate them), you may use the assigned generator. This special
generator will use the identifier value already assigned to the object's
identifier property. Be very careful when using this feature to assign keys
with business meaning (almost always a terrible design decision).

Due to its inherent nature, entities that use this generator cannot be saved
via the ISession's SaveOrUpdate() method. Instead you have to explicitly
specify to NHibernate if the object should be saved or updated by calling
either the Save() or Update() method of the ISession.
Esto para empezar...pero si buscas posts...hay varios problemas mas por
ahi...muchas cosas que NH hace por vos...tenes que pasar a resolverlas "a
mano"

Gustavo.

2008/12/29 Francisco A. Lozano <[email protected]>

>
> ¿Por qué es poco recomendable usar assigned?
>
> Francisco A. Lozano
>
>
>
> 2008/12/29 Gustavo Ringel <[email protected]>:
> > Si tomas cualquier estrategia que necesita id autogenerado por la DB
> > (native, identity) en el momento en que haces Save vas a recibir un hit
> en
> > la DB, con grabado incluido.
> >
> > Con assigned no puede ocurrir porque sos vos el encargado, pero es
> altamente
> > no recomendable usar assigned.
> >
> > Las estrategias recomendables a usar son hilo, guid.comb, uuid.hex...
> >
> > Yo favorezco hilo porque algunas db's no trabajan bien con guid, ademas
> de 4
> > bytes contra 16 bytes...si bien en los tiempos que corren cada vez es
> menos
> > importante...bueno, todavia me gusta tener menos hojas en los B-Trees...
> >
> > Gustavo.
> >
> > 2008/12/29 Francisco A. Lozano <[email protected]>
> >>
> >> Hola,
> >>
> >> De otro thread me pareció entender que habían situaciones en las que,
> >> incluso configurando la sesión para que el flush sólo se haga de forma
> >> explícita (flushmode), NHIbernate intentaría hacer un flush.
> >>
> >> ¿Cuales son estas situaciones? ¿Aparecerían igualmente si utilizo
> >> assigned como id-generator?
> >>
> >> Francisco A. Lozano
> >>
> >>
> >
> >
> > >
> >
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
Para escribir al Grupo, hágalo a esta dirección: 
[email protected]
Para más, visite: http://groups.google.com/group/NHibernate-Hispano
-~----------~----~----~----~------~----~------~--~---

Responder a