Hi guys,

I was trying to disable auto flush on session scope but it didn't
work.

I tried adding flush="transaction" to web.config, because it says in
the documentation for DefaultFlushType

        /// <summary>
        /// NH2.0-alike behaviour. The <see
cref="Castle.ActiveRecord.SessionScope"/> won't flush at all unless
        /// called manually. <see cref="Castle.ActiveRecord.TransactionScope"/
> flushes automatically. This
        /// allows to use the scopes like the NH-ISession-ITransaction-block.
        /// </summary>
        Transaction

But then i found this piece of code in SessinoScope.cs, and knew what
actually happened

        /// <summary>
        /// Performs the disposal.
        /// </summary>
        /// <param name="sessions">The sessions.</param>
        protected override void PerformDisposal(ICollection<ISession>
sessions)
        {
                if (hasSessionError || FlushAction == FlushAction.Never)
                {
                        PerformDisposal(sessions, false, true);
                }
                else
                {
                        PerformDisposal(sessions, true, true);
                }
        }

As you can see, when flush="transaction" is used, the value of
FlushAction is Config. So unless hasSessionError is true, it will
always auto flush the session scope (the else branch).

Please someone show me how I can get auto flush disabled through
web.config (or some other configuration). Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" 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/castle-project-users?hl=en.

Reply via email to