Visar,

In order to fasten startup time, you can serialize the Configuration
object:

Configuration cfg = new Configuration().Configure();
IFormatter serializer = new BinaryFormatter();

using (Stream stream = File.OpenWrite("Configuration.serialized"))
{
    serializer.Serialize(stream, configuration);
}

...

using (Stream stream = File.OpenRead("Configuration.serialized"))
{
    cfg = serializer.Deserialize(stream) as Configuration;
}

RP


On Mar 30, 7:04 pm, Fabio Maulo <[email protected]> wrote:
> The life cycle of the mapping is explained 
> herehttp://fabiomaulo.blogspot.com/2010/03/nhibernate-mappings-path.html
>
> 2010/3/30 Fabio Maulo <[email protected]>
>
>
>
>
>
> > The third...
> > After BuildSessionFatory all mapping-metadata are compiled to persisters
> > and you can throw the Configuration with its state.
>
> > 2010/3/30 Diego Mijelshon <[email protected]>
>
> > Fabio answered he first part, so I'll answer the second one:
>
> >> "Is the impact on performance only in startup? Or is it olso during CRUD
> >> operations?"
>
> >> Once the SessionFactory has been created, it doesn't matter how you
> >> configured it.
>
> >>    Diego
>
> >> On Tue, Mar 30, 2010 at 10:36, Visar Uruqi <[email protected]> wrote:
>
> >>> Is it true that if I specify details in the mapping xml file
> >>> like for example the data-type of the property the length and othe
> >>> constraints,
> >>> would result in a faster startup and better performance?
>
> >>> (I came to this idea when I enabled the log4net Logging library, and
> >>> got
> >>> a bunch of mapping and reflection statements in the logfile.txt, I
> >>> think Nhibernate was trying
> >>> to figure out what kind of data-type I am using in my POCO classes...
> >>> and therefore
> >>> consuming time and energy.
>
> >>> Let me show what I mean:
>
> >>> For example this is a mapping without specifying any details, just the
> >>> property names
> >>> <class name="Artikulli" table="Artikulli">
> >>>                <id name="ID">
> >>>                        <generator class="native" />
> >>>                </id>
> >>>                <property name="Emri"/>
> >>>                <property name="Pershkrimi"/>
> >>>                <property name="Data"/>
> >>>        </class>
>
> >>> And this is a mapping with data-type, length etc.
> >>> <class name="Article" table="Article">
> >>>                <id name="ID" column="ID">
> >>>                        <generator class="native" />
> >>>                </id>
> >>>                <property name="Name" type="String" length="50"/>
> >>>                <property name="Desc" type="String" length="50"/>
> >>>                <property name="Date" type="DateTime"/>
> >>>        </class>
>
> >>> The question is "Is this configuration going to be faster?" Consider
> >>> when you have 20 or more entities
> >>> Is the impact on performance only in startup? Or is it olso during
> >>> CRUD operations?
>
> >>> Visar
>
> >>> --
> >>> You received this message because you are subscribed to the Google Groups
> >>> "nhusers" group.
> >>> To post to this group, send email to [email protected].
> >>> To unsubscribe from this group, send email to
> >>> [email protected]<nhusers%[email protected]
> >>>  >
> >>> .
> >>> For more options, visit this group at
> >>>http://groups.google.com/group/nhusers?hl=en.
>
> >>  --
> >> You received this message because you are subscribed to the Google Groups
> >> "nhusers" group.
> >> To post to this group, send email to [email protected].
> >> To unsubscribe from this group, send email to
> >> [email protected]<nhusers%[email protected]
> >>  >
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/nhusers?hl=en.
>
> > --
> > Fabio Maulo
>
> --
> Fabio Maulo

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to