Saving the session in a database table will require some parsing and you will not be able to do direct queries.
Imagine this scenario:
You are updating the users table and specifically the user_last_update field with the last update timestamp. When that happens you update also the online table with the user_id, user_status, user_type, user_name, user_display_name, user_login_name, user_color, user_last_update - in short fields that you would like to display in your 'online' section.
All I have to do now is query the online table (which serves as my cache) and display the list of users that have updated information in the last x minutes. If I want to show all the users that are online of type 'moderator' first and then the rest of the users, we will need to just modify the SQL query and add the appropriate ORDER BY directive.
In a session equivalent you will need to store this information on the SESSION array and you will need to update it every time something happens. So if a user becomes online, everyone's session stored data will need to be updated so that they can see in their screens the updated online users on the next refresh. This is a lot more 'expensive' in processing time than querying a db table.
The contents of this message may contain confidential or privileged information and is intended solely for the recipient(s). Use or distribution to and by any other party is not authorized. If you are not the intended recipient, copying, distribution or use of the contents of this information is prohibited.
You can use the Zend_Session to store the cached data that will come from the online table and use that as a cache stored in one central location i.e. session table.
I hope this helps and again this is my view - it doesn't necessarily mean that it is the best solution for your needs.
Best regards
Nikolaos Dimopoulos
On Tue, Sep 15, 2009 at 00:25, sina miandashti <miandashti@gmail.com> wrote:
really thanks ... both of u guys
with Zend_Session_SaveHandler_DbTable
why u said parsing is hard?
how gonna Zend_Session_SaveHandler_DbTable store data in db? coded? or?
help more on this
i think Zend_Session_SaveHandler_DbTable will be the solution for my problem
--
________________
Sincerely
Sina Miandashti
MuSicBasE.ir & InvisionPower.ir Admin
没有评论:
发表评论