Firebird SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesFirebird SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 14th, 2005, 03:44 AM
1andy1 1andy1 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 18 1andy1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 29 m 18 sec
Reputation Power: 0
Send a message via ICQ to 1andy1
Question How to store session specific data?

Hi all,

I would like to store for example preffered language of current session. The preffered language is used in some views to get
text in the right language.

One of the possibility should be a temporary table for a session. Is it possible?

Andrej.

Reply With Quote
  #2  
Old January 14th, 2005, 11:23 AM
mariuz's Avatar
mariuz mariuz is offline
Bug Hunter
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Location: Transylvania (Romania)
Posts: 274 mariuz User rank is Corporal (100 - 500 Reputation Level)mariuz User rank is Corporal (100 - 500 Reputation Level)mariuz User rank is Corporal (100 - 500 Reputation Level)mariuz User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 20 h 12 m 34 sec
Reputation Power: 9
Lightbulb

Quote:
Originally Posted by 1andy1
Hi all,

I would like to store for example preffered language of current session. The preffered language is used in some views to get
text in the right language.

One of the possibility should be a temporary table for a session. Is it possible?

Andrej.

you could use one real table where to keep current lang of seesion
and delete it after the session expires
__________________
My home page: http://www.firebirdsql.org and work place :http://www.reea.net

Reply With Quote
  #3  
Old January 17th, 2005, 01:51 AM
1andy1 1andy1 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 18 1andy1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 29 m 18 sec
Reputation Power: 0
Send a message via ICQ to 1andy1
Quote:
Originally Posted by mariuz
you could use one real table where to keep current lang of seesion
and delete it after the session expires


OK,

you mean to create a table t_sessions and one record in the table means one session? If so then there is a problem if the application crashes the record will not be deleted. Or is it a trigger eg. BeforeKillSession in firebird? I have to keep my table t_sessions consistent with current opened sessions. At least I have to know current sesson id. Is it possible?

Thanks,
Andrej.

Reply With Quote
  #4  
Old January 17th, 2005, 05:52 AM
SilverDB's Avatar
SilverDB SilverDB is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: Romania
Posts: 173 SilverDB User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 45 m 53 sec
Reputation Power: 5
Send a message via Yahoo to SilverDB
Lightbulb

If I were You in this situation this is what I would do:

Create a table containing 2 columns ... USER_ID and LANGUAGE_ID ... for example. At application startup I would run a query like
Code:
DELETE FROM MYTABLE WHERE USER_ID=:USER_ID

then store the session's settings/variable/language id ... and that's all ...

Now you can be sure that even if your application hangs, the next time the user logs in, the previous settings are erased

Good luck,
Silver

Reply With Quote
  #5  
Old January 17th, 2005, 06:23 AM
1andy1 1andy1 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 18 1andy1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 29 m 18 sec
Reputation Power: 0
Send a message via ICQ to 1andy1
Quote:
Originally Posted by SilverDB
If I were You in this situation this is what I would do:

Create a table containing 2 columns ... USER_ID and LANGUAGE_ID ... for example. At application startup I would run a query like
Code:
DELETE FROM MYTABLE WHERE USER_ID=:USER_ID

then store the session's settings/variable/language id ... and that's all ...

Now you can be sure that even if your application hangs, the next time the user logs in, the previous settings are erased

Good luck,
Silver


It is not so easy.
In my application there can be connected two users with the same user_id. It seams that there is no other way then having session id. Hopefully Firebird will support it sometimes.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesFirebird SQL Development > How to store session specific data?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT