April 29, 2009 at 12:23 pm
I had a lot of coffee today and I think I may have blown a few neurons so if I jumped the tracks and need to pay out settlements to all my passengers families let me know...
I have your a semi complex application/database relationship going on. Quick and simple: There are going to be several versions of an application connecting to my one database. As time goes on, both the appliction and the database will updated and change versions. That means the database will always be up to date, but the applications may not be.
Since I have control over the database, and I can't force my clients to upgrade, I plan on having the application pass the version number to the database right after connecting, and the database either allowing the application to operate normally or operate in a restricted mode (where it can't access some features because they changed).
How should I go about this? I thought of two ways:
1) (pretty sure this isn't possible) After determining the application version, setting the permissions for the specific connection (not the user, since all versions of the application will be connecting with the same username/pw per corporate policy)
2) Storing the permissions in a session variable (like the php $_SESSION[], does sql have?), or in a custom made session table (ew!) based on the connection id
Respond:
-Does this whole mess make sense?
-Can you set permssions (ie GRANT SELECT) on a connection rather than a user name?
-Does SQL support session variables of some kind?
---
Dlongnecker
April 29, 2009 at 1:50 pm
Respond:
-Does this whole mess make sense?
-Can you set permssions (ie GRANT SELECT) on a connection rather than a user name?
-Does SQL support session variables of some kind?
-YES
-NO
-Not Really but there is a concept of a temp table that is visible during the session. It might work for you but I do not like using temp tables for such extended scope.
You may try the following.
Create a 'login' SP which will provide you with the app version. Within this 'login'SP use the HOST_NAME to get the name of the host using your app. Store the version and the corresponding host name in a table.
This table will give you the host names and their versions of the app.
Then each SP called will have to examine this table vs the HOST_NAME function to figure out version of the app calling the SP and figure out the logic to use.
Of course I hope you plan on using SPs as your app interface and do not allow for direct SELECTS, INSERTS and such.
Does this make sense?
---------------------------------------------
[font="Verdana"]Nothing is impossible.
It is just a matter of time and money.[/font]
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply