Si el dialecto no soporta, entonces quizas tengas que hacer
session.CreateSQLQuery("delete....").ExecuteUpdate();

2011/6/22 Nicolás Marzoni <[email protected]>

> Buenas a todos.
> Necesito borrar aproximadamente 100000 registros que heredan de una
> clase Alarma.
>
> public abstract class Alarma () {}
>
> public class Alarma1 : Alarma() {}
>
> public class Alarma2 : Alarma() {}
>
> Para borrar los registros estoy intentando haciendo:
>
>        public void BorrarHistorial(DateTime? desde, DateTime? hasta)
>        {
>            var session = _sessionProvider.GetCurrentSession();
>
>            using (var tx = session.BeginTransaction())
>            {
>                ...
>
>                IQuery hqlDelete = session.CreateQuery("delete Alarma
> r where r.FechaDeInicio >= :desde");
>                    hqlDelete.SetParameter("desde", desde);
>                    hqlDelete.ExecuteUpdate();
>
>                ...
>
>                tx.Commit();
>            }
>        }
>
> Pero al hacerlo obtengo el siguiente error:
> "NHibernate.HibernateException: cannot perform multi-table deletes
> using dialect not supporting temp tables"
>
> Por el momento puedo hacerlo iterando entre los registros y
> eliminarlos haciendo session.Delete(alarma).
> ¿Cual sería la solucion más adecuada para eliminar todos registros?
>
> Muchas Gracias!
> Saludos.
>
> --
> Para escribir al Grupo, hágalo a esta dirección:
> [email protected]
> Para más, visite: http://groups.google.com/group/NHibernate-Hispano




-- 
Dario Quintana

-- 
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