Re: Newbie: connected user

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Sat Jan 08 2005 - 20:48:28 EST

  • Next message: Koka: "Re: Newbie: connected user"

    Hello,

    Is this really a question about JDBC connection - could you confirm
    that this is what you want? I mean there is a reason why such pattern
    is not used - web applications are multi-user by definition and having
    a separate login id for JDBC connection per user rarely (if ever) makes
    sense.

    For standalone desktop client apps you can use this code -
    http://objectstyle.org/cayenne/lists/cayenne-user/2004/11/0010.html .
    But before even giving any advise regrading web apps first I want to
    understand better what are you trying to do. Could you explain what
    application you are writing?

    Andrus

    On Jan 8, 2005, at 5:49 PM, Mike Kienenberger wrote:
    > Koka <22605..mail.com> wrote:
    >> Sorry for this newbie question, but I already lost more time looking
    >> for proper way to understand it than it took to download/install/set
    >> up cayenne-tapestry-app example...
    >>
    >> What I need is to have a login page and make Cayenne use connection
    >> credentials (username/ password) supplyed by the user at this login
    >> page. So when and how can I customise cayenne initialization?
    >
    > That's a good question.
    >
    > Most Cayenne use cases I've had up to this point use database
    > connections
    > with predefined username/passwords.
    >
    > It sounds like you want a new database connection with unique
    > username/password information with every web session.
    >
    > I think you would have to create a new DataNode for every user.
    > And I think each DataNode has to be uniquely named.
    >
    > You could probably use DataNode.setDataSource() to provide a DataSource
    > object with the proper username/password once you figured out how to
    > build
    > new unique DataNodes for each web session.
    >
    > Perhaps the creation of DataNodes can be done by calling
    > DataDomain.addNode() for each one.
    >
    > That's my guess on where you'd start looking. Probably someone else
    > can
    > provide better information.
    >
    > However, I don't think what you're doing easily fits into what's
    > considered
    > "standard" cayenne use patterns.
    >
    > That might just mean that Cayenne needs to provide a new use pattern,
    > though
    > :)
    >
    > -Mike



    This archive was generated by hypermail 2.0.0 : Sat Jan 08 2005 - 20:48:33 EST