Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is X?
Message
General information
Forum:
Games
Category:
Trivia
Title:
Miscellaneous
Thread ID:
00752760
Message ID:
00753031
Views:
50
>I enjoyed what you had to say about session variables. How about using the database connection handle to track a user. For example, when a user logs into a shopping cart app using a persistent connection, the database would issue a connection handle that would be needed for any subsequent inserts, updates, or deletes. The app could make an insert to a table that would track the connection. The following could be entered into the connection table:
>
>Would this be feasible?
>

Feasible? Hmm...yes, but I wouldn't go that route. Generally, web apps. reuse the same connection handle to a database. Connecting to the backend typically takes a fair amount of time. It's not something I'd want happening everytime a new user hit my site. On low volume sites, it might not be an issue. However, it's not going to scale very well.

You have a few problems: each open connection uses some memory up on the server; the additional connection time for new users; and since everything is stateless, you never know when it's safe to release the database connection. A user might decide at any point to go to another site, disconnect from the internet, etc. In the meantime, you've still got an open connection to the backend. I suppose you could expire them out periodically, but you're doing a lot of work for no real benefit. Sessions (as implemented in most Web environments, eg. ASP, ASP.NET, WebConnect, etc.) already do most of this work for you.
-Paul

RCS Solutions, Inc.
Blog
Twitter
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform