delphi - Multiple Connections for a single user -
delphi - Multiple Connections for a single user -
i trying figure best / "correct" place set next logic in delphi datasnap server.
a user connects server, , using credentials provided validate them using centralized authorizationdatabase (oracle database). if are, in fact, valid user, want given them connection info resides based on authorization repository says (could host,database,username, password).
i have authorizationdatabase in own server class, server life cycle, since noone can in without beingness validated there. create problem concurrency? 10 users login validated @ same time, work ok?
i have base of operations server module, session level info modules derive from, has application connection. application connection parameters can alter based on user logging in.
the problem having set authorization / validation / new db parameter assignment process.
where kind of two-step database approach best fit? seems rather common, user verified in 1 place, info going accessing in another.
in reviewing examples, don't see obvious place go.
it not safe share 1 connection across multiple sessions, "read error" or other error when 2 sessions seek read database @ same time.
but can have centralized place login, create thread safe, do:
tmonitor.enter(logindm); seek valid := logindm.login(username, password); tmonitor.exit(logindm); end;
about user acessing data, each user have own session runs on thread, can create 1 connection per serverclass instance , define lifecicle "session", each new session spawn new servermethod's class instance , have own connection, way not need worry way write server methods, have own "exclusive" connection.
delphi datasnap
Comments
Post a Comment