ibatis-user-cs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zarar Siddiqi" <zar...@gmail.com>
Subject Re: Weird but reproducable problem which sets HttpContext to null
Date Mon, 11 Sep 2006 23:16:28 GMT
Thanks for the response.  What you're saying makes sense and I
concluded the same but what threw me off was that initially everything
is working fine (i.e.: the app can access the database) but after a
certain point in time, it loses the session.

So what is the best method of making sure a worker thread has access
to an IBatis session?  Here is how I start the thread in the
Global.asax.cs file:

Timer timer = new Timer();
timer.Interval = shipmentCheckInterval;
timer.Elapsed += new ElapsedEventHandler(checkForShipments);
timer.Enabled = true;
timer.Start();

The checkForShipments() method makes the database calls.

How do I make sure that checkForShipments() doesn't lose the IBatis session?

Thanks for your help.

Zarar




On 9/11/06, Gilles Bayon <ibatis.net@gmail.com> wrote:
> The session storage is different depending you are or not in web context.
> It seems your background process is not running in web context (?) but
> the your SqlMapper heve been initialized in web context so it tries to
> retrieve the session in web context and fails.
>
>
> --
> Cheers,
> Gilles
>
> <a href="http://www.amazon.com/gp/registry/6JCP7AORB0LE">Wish List</a>
>

Mime
View raw message