This is because SessionScope has to open a NH transaction implicitly (I
stopped counting how often I cursed NH2.x for making transactions
mandatory...). NH opens a DB transaction for it. If your isolation level is
repeatable read, SSMS is locked out because SQLServer waits for the
transaction to be commited or rolled back. This one happens only when an
exception is thrown or the session scope is disposed.

To work around it, set isolation level to read uncommitted.

-Markus

2009/4/28 chitech <[email protected]>

>
> Alo
>
> I have setup our web application environment with ActiveRecord &
> NHibernate. See web.config
>
> <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/
> v2.0">
>  <configSections>
>    <section name="activeRecord"
> type="Castle.ActiveRecord.Framework.Config.ActiveRecordSectionHandler,
> Castle.ActiveRecord"/>
>  ...
>  </configSections>
>  <connectionStrings>
>    <add name="Jobcenter" connectionString="$
> {Jobcenter_connectionString}" providerName="System.Data.SqlClient" />
>    <add name="JobcenterLog" connectionString="$
> {JobcenterLog_connectionString}" providerName="System.Data.SqlClient" /
> >
>  </connectionStrings>
>  <activeRecord isWeb="true" isDebug="${Debug}">
>    <config>
>      <add key="connection.driver class"
> value="NHibernate.Driver.SqlClientDriver"/>
>      <add key="dialect" value="NHibernate.Dialect.MsSql2005Dialect"/>
>      <add key="connection.provider"
> value="NHibernate.Connection.DriverConnectionProvider"/>
>      <add key="connection.connection_string" value="$
> {Jobcenter_connectionString}"/>
>      <add key="proxyfactory.factory_class"
> value="NHibernate.ByteCode.Castle.ProxyFactoryFactory,
> NHibernate.ByteCode.Castle"/>
>      <add key="show_sql" value="true" />
>    </config>
>  </activeRecord>
>    <httpModules>
>      <add name="ar.sessionscope"
> type="Castle.ActiveRecord.Framework.SessionScopeWebModule,
> Castle.ActiveRecord" />
>       ...
>    </httpModules>
>   ...
> </configuration>
>
> When I try to debug inside a SessionScope (SessionScopeWebModule)
> after a Repository.Save() I can't access the table from SQL Management
> Studio. I get a timeout.Should it work this way? or is it only in
> debug mode it behavior like this. This ConnectionStrings section in
> Web.Config is the legacy ADO.net
>
> >
>

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