The DifferentDatabaseScope seems a better idea than my previous proposition.
As for it's implementation, look at the SessionScopeWebModule: https://svn.castleproject.org/svn/castle/trunk/ActiveRecord/Castle.ActiveRecord/Framework/SessionScopeWebModule.cs you normally register it in your web.config, so you can implement the HttpModule yourself with your own logic and use DifferentDatabaseScope instead of plain SessionScope On Dec 2, 9:14 pm, Gabriel Mancini de Campos <[EMAIL PROTECTED]> wrote: > how? like a filter or a interceptor? > > how i made this tecnic no intrusion code? some idea? > > On 2 dez, 17:00, "Markus Zywitza" <[EMAIL PROTECTED]> wrote: > > > You can use it like any other SessionScope. For example store the connection > > string in the HTTP session and use session per request with a > > DifferentDatabaseScope. > > > -Markus > > > 2008/12/2 Gabriel Mancini de Campos <[EMAIL PROTECTED]> > > > > yeah it´s a good alternative, > > > > but i will need to write this block in all places? > > > > On Dec 2, 9:19 am, "Markus Zywitza" <[EMAIL PROTECTED]> wrote: > > > > From Unit Tests: > > > > > SqlConnection conn = CreateSqlConnection(); > > > > using(conn) > > > > { > > > > conn.Open(); > > > > using(new DifferentDatabaseScope(conn)) > > > > { > > > > blog.Create(); > > > > } > > > > > } > > > > > See > > > > \trunk\ActiveRecord\Castle.ActiveRecord.Tests\DifferentDatabaseScopeTestCas > > > e.cs > > > > for more. Sorry, Castle is closed on FishEye, so I couldn't just link it > > > > here :-( > > > > > -Markus > > > > > 2008/12/2 Gabriel Mancini de Campos <[EMAIL PROTECTED]> > > > > > > yes, theres identical > > > > > > On Dec 2, 6:37 am, "Markus Zywitza" <[EMAIL PROTECTED]> wrote: > > > > > > DifferentDatabaseScope is the preferred way for such a scenario, > > > since > > > > > table > > > > > > structure and hence AR classes are identical fro all databases. > > > > > > > -Markus > > > > > > > 2008/12/2 josh robb <[EMAIL PROTECTED]> > > > > > > > > There is also DifferentDatabaseScope... > > > > > > > > On Tue, Dec 2, 2008 at 7:03 AM, Ricardo Borges < > > > > > [EMAIL PROTECTED]> > > > > > > > wrote: > > > > > > > > > It is only possible with base entity inheritance. The base type > > > is > > > > > > > > associated to the database config... > > > > > > > > > <config type="Full Type name to Abstract Class that defines > > > > > boundaries > > > > > > > > for different database"> > > > > > > > > <add key="connection.driver_class" value="NHibernate > > > > > Driver" > > > > > > > /> > > > >http://www.castleproject.org/activerecord/documentation/trunk/advance. > > > > > .. > > > >http://www.castleproject.org/activerecord/documentation/trunk/manual/.< > > >http://www.castleproject.org/activerecord/documentation/trunk/manual/> > > > > > .. > > > > > > > > > 2008/12/1 Gabriel Mancini de Campos <[EMAIL PROTECTED]>: > > > > > > > > >> Hi All, > > > > > > > > >> In my Screen "Login" i have a drop-down with some databases > > > names. > > > > > > > >> this db´s can be in separeted servers, but i can yours > > > connections > > > > > > > >> Strings, but > > > > > > > >> when i login, i need to select how Data Base i will use. > > > > > > > >> My question is: > > > > > > > >> How can i connect to data base selected by the user? > > > > > > > >> or how can i change the DB made a logoff and new login. using > > > AR. > > > > > > > >> All this DB´s have the same Structure. (or in less their hav > > > to > > > > > > > >> be). > > > > > > > > >> thank all > > > > > > > > >> sorry my english sux! :( > > > > > > > >> Gabriel --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
