I like the idea (and have implemented something similar, although with less smartness), but there are a few things to consider:
1. Allowing only mapped classes to be bulked can be a bit limiting. 2. The fallback should use plain inserts. Using Session.Save gives a very different behavior. 3. On e.g MSSQL it is possible to retrieve post insert identifiers. 4. It may be a good idea to disallow Session bound instances to be bulked, or the pending Session.Flush may perform unnecessary/bad things. Also, it would be nice if bulking was a feature of the persisters. "I have 1000 pending insert of type X which is bulk insertable. I'll use that." /G 2014-10-29 2:00 GMT+01:00 Ricardo Peres <[email protected]>: > Hi, > > I submitted a pull request for https://nhibernate.jira.com/browse/NH-3675. > This is for supporting bulk inserts in NHibernate through the native > ADO.NET provider. For example, SqlClient uses SqlBulkCopy, > Oracle.DataAccess uses OracleBulkCopy, etc. > I would like to hear from you about this. The API is very simple: > > session.BulkInsert(new Entity[] { new Entity { }, ... }); > > I only implemented support for SqlClient and Oracle.DataAccess, other > drivers get a dummy implementation that just does regular saves as a > fallback. AFAIK, at least MySQL also supports this, but it does so through > CSV files. Maybe someone else can provide support for this. > > RP > > -- > > --- > You received this message because you are subscribed to the Google Groups > "nhibernate-development" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- --- You received this message because you are subscribed to the Google Groups "nhibernate-development" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
