Has I corrected in the next post, I need to retrieve from the DB 60K entities. And YES this is not too much...
I need to make a TimeEstimator program for a Public Passenger Transport TimePredicition, and the entitie is the "Connection Times between 2 BusStop". Of course I can use a direct SELECT, probably that I will do. No question on that... I'm a true believer in NHibernate, so I think that if this is a bottlneck in NH why don't we look at it... :D I can help wit more information if needed. Ricardo On 3 Set, 15:16, Fabio Maulo <[email protected]> wrote: > Ricardo, > Can you explain the real life use-case where you need to upload 100K > entities ?I would add a real life meaning to my post. > > 2009/9/3 Ricardo Pedro <[email protected]> > > > > > > > > > I also found that the most time consuming in the stateless session is > > creating Proxies when the materializing is done. > > > I'm using NHibernate 2.0. > > > The object SessionScope is encapsulating the real Session/ > > StatelessSession. > > > This is the TestUnit Code: > > > [Test] > > public void TestStatelessSession() > > { > > long ts, ts1; > > BDManagerBaseClass.GetInstance(); > > using (SessionScope scope = > > BDManagerBaseClass.Instance.NewSessionScope()) > > { > > scope.DisableAutoFlush(); > > Stopwatch sw = new Stopwatch(); > > sw.Start(); > > IList<ConnectionTime> times = > > scope.Session.CreateCriteria(typeof > > (ConnectionTime)).List<ConnectionTime>(); > > ts = sw.ElapsedMilliseconds; > > } > > > using (StatelessSessionScope scope = > > BDManagerBaseClass.Instance.NewStatelessSessionScope()) > > { > > Stopwatch sw = new Stopwatch(); > > sw.Start(); > > IList<ConnectionTime> times = > > scope.StatelessSession.CreateCriteria<ConnectionTime> > > ().List<ConnectionTime>(); > > ts1 = sw.ElapsedMilliseconds; > > } > > > Console.WriteLine("ts: {0} ms --- ts1: {1} ms", ts, ts1); > > } > > > This is the POCO > > > [Class(Table = "ConnectionTime", DynamicUpdate=true)] > > public class ConnectionTime > > { > > > #region Fields > > > private BusStop busStop; > > private Branch branch; > > > #endregion > > > #region Properties > > > [Id(Column = "ID", Name = "ID", Type = "Int32")] > > [Generator(1, Class = "native")] > > public virtual int ID { get; set; } > > > [ManyToOne(Column="EPOCA")] > > public virtual Season Season { get; set; } > > > [ManyToOne(Column="CONNECTION_ID")] > > public virtual Connection Connection {get; set;} > > > [ManyToOne(Column="NR_VARIANTE")] > > public virtual TimeVariant TimeVariant { get; set; } > > > [ManyToOne(Column="DIA_TIPO")] > > public virtual Day Day { get; set; } > > > [Property(Column = "TEMPO_PERCURSO", Type = "Int32")] > > public virtual int TravelTime { get; set; } > > > [Property(Column = "TEMPO_PARADO", Type = "Int32")] > > public virtual int StopTime { get; set; } > > > public virtual int AccumulatedTravelTime { get; set; } > > > #endregion > > > } > > -- > Fabio Maulo- Ocultar texto citado - > > - Mostrar texto citado - --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
