Hi Zarar
I'm experiencing similar problems to those that you had a whole ago,
relating to HttpContext being null (see thread below).
My situation as follows:
I'm using IBatis (DataAccess and DataMapper) to access my database. I am
trying to use the same code inside an asp website, as the back end of a
web service and as the data access for a windows app.
This was all working fine, until I tried to add support for
SqlDependency callbacks. SqlDependencies call back to the code in a
different thread, and it seems in the ASP version of my app, that the
HttpContext is missing, when I try to access data during a callback.
I was wondering if you found a good solution to the problem? Did you end
up implementing a new ISessionStore?
Any advice on how to proceed would be much appreciated,
Thanks,
Greg
Re: Writing a custom session store by implementing ISessionStore
Zarar Siddiqi
Mon, 09 Oct 2006 11:48:28 -0700
I'll go with this solution then. Thank you very much.
Zarar
On 10/9/06, Gilles Bayon <[EMAIL PROTECTED]> wrote:
A CallContextSessionStore is not 100% safe in web environnement.
A better solution in your thread code is :
MyBackgroundCodeTask()
{
IDalSession session = sqlMapper.CreateSqlMapSession();
session.OpenConnection();
IMappedStatement myStatement = GetMappedStatement("statementName",
parameterObject);
... myStatement.ExecuteQueryForObject(session, parameterObject);
session.CloseConnection();
}
--
Cheers,
Gilles
<a href="http://www.amazon.com/gp/registry/6JCP7AORB0LE"
<http://www.amazon.com/gp/registry/6JCP7AORB0LE%22> ;>Wish List</a>