ibatis-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gilles Bayon (JIRA)" <ibatis-...@incubator.apache.org>
Subject [jira] Commented: (IBATISNET-185) Allow custom ISessionStoreFactory
Date Mon, 09 Oct 2006 17:00:21 GMT
    [ http://issues.apache.org/jira/browse/IBATISNET-185?page=comments#action_12440926 ] 
Gilles Bayon commented on IBATISNET-185:


The HybridSessionStoreFactory  is not the solution, there should be only 2 SessionStoreFactory
in iBATIS :
HttpContextSessionStore for Web environnement and CallContextSessionStore for other environnement.

> Allow custom ISessionStoreFactory
> ---------------------------------
>                 Key: IBATISNET-185
>                 URL: http://issues.apache.org/jira/browse/IBATISNET-185
>             Project: iBatis for .NET
>          Issue Type: Improvement
>          Components: DataMapper, DataAccess
>            Reporter: Ron Grabowski
>            Priority: Minor
> The interfaces and abstract class in IBatisNet.DataAccess.SessionScope and IBatisNet.DataMapper.SessionScope
should be combined and moved into IBatisNet.Common and a new interface named IBatisNet.Common.SessionStore.ISessionStoreFactory
should be created:
> public interface ISessionStoreFactory
> {
>  void Initialize(IDictionary properties);
>  ISessionStore GetSessionStore(string sessionStore);
>  // void Shutdown(); ???
> }
> "setting" nodes in the SqlMap.config file currently only contains boolean values. I think
we should keep with that convention if possible and introduce a seperate node named "sessionStoreFactory"
that should mimic the custom cache support (allow properties to be passed into the Initialize
>  <sessionStoreFactory type="Company.IBatisNet.CustomSessionStoreFactory, Company.IBatisNet">
>   <property name="Hello" value="World" />
>  </sessionStoreFactory>
> IBatisNet should ship with at least two factories:
>  CallContextSessionStoreFactory
>  HybridSessionStoreFactory (HttpContext != null ? HttpContextSessionStore : CallContextSessionStore)
> The default factory would be HybirdSessionStoreFactory. The user could manually specify
one of the built-in factories by using an upper case alias:
>  <sessionStoreFactory type="CALLCONTEXT" />
>  <sessionStoreFactory type="HYBRID" />
> For the DataAccess project, a context could use a custom session store factory like this:
>  <daoSessionHandler id="SqlMap">
>   <property name="resource" value="SqlMap_MSSQL_OleDb.config"/>
>   <property name="sessionStoreFactory" value="Company.IBatisNet.CustomSessionStoreFactory,
>   <property name="Hello" value="World"/>
>  </daoSessionHandler>
> The IDictionary passed into ISessionStoreFactory.Initialize would contain three keys:
resource, sessionStoreFactory, and Hello.
> If you wanted to always use CALLCONTEXT with a data access context:
>  <daoSessionHandler id="SqlMap">
>   <property name="resource" value="SqlMap_MSSQL_OleDb.config"/>
>   <property name="sessionStoreFactory" value="CALLCONTEXT"/>
>  </daoSessionHandler>

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


View raw message