Share datacontext between users?

From: Twan Kogels (twa..wansoft.com)
Date: Mon Sep 12 2005 - 06:50:58 EDT

  • Next message: Robert Zeigler: "Re: Share datacontext between users?"

    Hello all,

    Last week i bumped into a strange behaviour. I have a webapp which allows
    users to login, when a user is logged in he can modify a list of items. Now
    2 users login, a WebApplicationListener assigns a DataContext to the
    Session. I get the datacontext when i need to do a query by calling :

    DataContext ctxt =
    BasicServletConfiguration.getDefaultContext(request.getSession());

    So this means if i understand the documentation right that each user get a
    different DataContext.

    User 1 logs in, User 2 logs in.
    Now User1 deletes a Item, let's say item1. User1 views the list of items
    and sees that item1 is deleted.
    5 seconds later User2 views the list and item1 is still there. User2 tries
    to delete item1 but this causes a exception cause User1 has already deleted
    item1.
    If User2 logs out and logs in again (new session created), and views the
    list then item1 is gone.

    I think the problem lies in the way i set or retrieve the datacontext.

    Is there a way to let users share a DataContext so that they will see each
    other actions? Or is it maybe something different?

    Kind regards,
    Twan



    This archive was generated by hypermail 2.0.0 : Mon Sep 12 2005 - 07:09:20 EDT