c# - Multiple Saves in NHibernate (2.1) -


How can the collection of objects in NHibernate? I'm a migration from Subsonic (I do not like the SubSonic version 3 and SubSonic 2 is dead ...) and it was used for a simple operation ...

One of the mapping of the collection The way (without association) to complete this task?

My actual code is: use of

  (Asynchronous session = NHibernateHelper.GetCurrentSession ()) {{ITRansaction transaction = session Start transaction ()) {foreach (in player Diverse player) {session. Save (player); Transaction.Commit (); thank you in advanced!  

You need it Transaction outside your loop Target of a transaction is essentially In 1 call, databases have to batch multiple operations. Here is the edited version: Use of

  (session session = NHibernateHelper.GetCurrentSession ()) {{Transfer transactions = session.BeginTransaction ()) {foreach (different players in players) {session.Save (Player); } Transactions. Communication (); }}  

Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -