Hola a todos

Tengo un problema con un interceptor, vera lo he creado asi:
 public class Interceptor: IInterceptor
    {
        private ISession ses;

        #region Miembros de IInterceptor

        public void AfterTransactionBegin(ITransaction tx)
        {
        }

        public void AfterTransactionCompletion(ITransaction tx)
        {
        }

        public void BeforeTransactionCompletion(ITransaction tx)
        {
        }

        public int[] FindDirty(object entity, object id, object[]
currentState, object[] previousState, string[] propertyNames,
NHibernate.Type.IType[] types)
        {
            return null;
        }

        public object GetEntity(string entityName, object id)
        {
            return null;
        }

        public string GetEntityName(object entity)
        {
            return entity.GetType().Name;
        }

        public object Instantiate(string entityName, EntityMode
entityMode, object id)
        {
            return null;
        }

        public bool? IsTransient(object entity)
        {
            return true;
        }

        public void OnCollectionRecreate(object collection, object
key)
        {
        }

        public void OnCollectionRemove(object collection, object key)
        {
        }

        public void OnCollectionUpdate(object collection, object key)
        {
        }

        public void OnDelete(object entity, object id, object[] state,
string[] propertyNames, NHibernate.Type.IType[] types)
        {
        }

        public bool OnFlushDirty(object entity, object id, object[]
currentState, object[] previousState, string[] propertyNames,
NHibernate.Type.IType[] types)
        {
            return false;
        }

        public bool OnLoad(object entity, object id, object[] state,
string[] propertyNames, NHibernate.Type.IType[] types)
        {
            return true;
        }

        public NHibernate.SqlCommand.SqlString OnPrepareStatement
(NHibernate.SqlCommand.SqlString sql)
        {
            return sql;
        }

        public bool OnSave(object entity, object id, object[] state,
string[] propertyNames, NHibernate.Type.IType[] types)
        {
            int i = 0;
            while (i < propertyNames.Length && propertyNames[i] !=
"Usuario")
            {
                i++;
            }
            if (i < propertyNames.Length)
            {
                state[i] = Entorno.Usuario.Login;
            }
            return true;
        }

        public void PostFlush(System.Collections.ICollection entities)
        {
        }

        public void PreFlush(System.Collections.ICollection entities)
        {
        }

        public void SetSession(ISession session)
        {
            ses = session;
        }

        #endregion
    }


y funciona bien, pero el problema se da cuando hago esto:


            General.CopiarObjeto(cli, esp);
            esp.Cliente = cli;
            esp.Estado = 'M';
            Entorno.GetSessionActual().Save(esp);
            Entorno.GetSessionActual().Flush();

veran esp es una entidad temporal en donde se graban todos los datos
de un cliente, esto lo hago asi por que debe haber un administrador
que valide estos cambios; como vera he creado una rutina que copiara
los valores de las propiedades, de 'cli' a 'esp', cuando le doy flush
moe bota el siguiente error:

object references an unsaved transient instance - save the transient
instance before flushing: Entidades.Cliente

Alguna idea por favor?
--~--~---------~--~----~------------~-------~--~----~
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