Gabriel Mancini de Campos
unread,Mar 6, 2009, 9:30:44 AM3/6/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Castle Project Users
Hi evey one,
I Have this senario,
When the user abandon my application, i need do some updates in my
base. in this moment show me this error.
My Confis is in a object, because i need change some configurations
in run-time.
in Web.config
<add name="ar.sessionscope"
type="Castle.ActiveRecord.Framework.SessionScopeWebModule,
Castle.ActiveRecord"/>
--this is the only configuration of ar in my web.config
in Global.asax
protected void Application_Start(object sender, EventArgs e)
{
ActiveRecordStarter.Initialize(ARConfig.GetArAssembys(),
ARConfig.GetArSource());
}
public class ARConfig
{
public static Assembly[] GetArAssembys()
{
return new Assembly[] { Assembly.Load("Sof.Log"),
Assembly.Load("ChatManager.Model"), Assembly.Load("Exceller.Context"),
Assembly.Load("ControleAcesso.Model") };
}
public static InPlaceConfigurationSource GetArSource()
{
InPlaceConfigurationSource source = new
InPlaceConfigurationSource
{
ThreadScopeInfoImplementation = typeof
(HybridWebThreadScopeInfo),
IsRunningInWebApp = true,
VerifyModelsAgainstDBSchema = true
};
source.Add(typeof(ActiveRecordBase), new
Dictionary<string, string>
{
{"connection.driver_class","NHibernate.Driver.SqlClientDriver"},
{"dialect",
"NHibernate.Dialect.MsSql2000Dialect"},
{"connection.provider","NHibernate.Connection.DriverConnectionProvider"},
{"connection.connection_string", "Password=1234;Persist Security
Info=True;User ID=chatdbuser;Initial Catalog=ChatManager;Data
Source=sofdb1;Min Pool Size=5;Max Pool Size=100;Connect Timeout=60;"},
{"proxyfactory.factory_class",
"NHibernate.ByteCode.Castle.ProxyFactoryFactory,
NHibernate.ByteCode.Castle"},
}); // Framework
(LOG)
source.Add(typeof(ChatBaseModel<,>), new
Dictionary<string, string>
{
{"connection.driver_class","NHibernate.Driver.SqlClientDriver"},
{"dialect",
"NHibernate.Dialect.MsSql2000Dialect"},
{"connection.provider","NHibernate.Connection.DriverConnectionProvider"},
{"connection.connection_string", "Password=1234;Persist Security
Info=True;User ID=chatdbuser;Initial Catalog=ChatManager;Data
Source=sofdb1;Min Pool Size=5;Max Pool Size=100;Connect Timeout=60;"},
{"proxyfactory.factory_class",
"NHibernate.ByteCode.Castle.ProxyFactoryFactory,
NHibernate.ByteCode.Castle"},
}); // Chat
source.Add(typeof(ExcellerContextBaseModel<>), new
Dictionary<string, string>
{
{"connection.driver_class","NHibernate.Driver.SqlClientDriver"},
{"dialect", "NHibernate.Dialect.MsSql2000Dialect"},
{"connection.provider","NHibernate.Connection.DriverConnectionProvider"},
{"connection.connection_string", "Password=1234;Persist Security
Info=True;User ID=chatdbuser;Initial Catalog=ChatManager;Data
Source=sofdb1;Min Pool Size=5;Max Pool Size=100;Connect Timeout=60;"},
{"proxyfactory.factory_class",
"NHibernate.ByteCode.Castle.ProxyFactoryFactory,
NHibernate.ByteCode.Castle"},
}); //
Botao e Acesso
source.Add(typeof(ControleAcessoBaseModel<>), new
Dictionary<string, string>
{
{"connection.driver_class","NHibernate.Driver.SqlClientDriver"},
{"dialect", "NHibernate.Dialect.MsSql2000Dialect"},
{"connection.provider","NHibernate.Connection.DriverConnectionProvider"},
{"connection.connection_string", "Password=sofdbuser;Persist Security
Info=True;User ID=sofdbuser;Initial Catalog=SOF_EXC_PRD_V230;Data
Source=sofdb1;Min Pool Size=5;Max Pool Size=100;Connect Timeout=60;"},
{"proxyfactory.factory_class",
"NHibernate.ByteCode.Castle.ProxyFactoryFactory,
NHibernate.ByteCode.Castle"},
}); //
Link para a tabela de Usuarios
return source;
}
}