|
-- Function: aspnet_session_getsessionstoreitem()
CREATE OR REPLACE FUNCTION aspnet_session_getsessionstoreitem2(
IN iSessionId aspnet_session.sessionid%TYPE,
IN iAppId aspnet_session.appid%TYPE,
IN iLockRecord boolean,
OUT oLockId aspnet_session.LockId%TYPE,
OUT oLockDate aspnet_session.LockDate%TYPE,
OUT oLockedRecord boolean,
OUT oActionFlags aspnet_session.Flags%TYPE,
OUT oSessionItems aspnet_session.SessionItems%TYPE
)
AS
$BODY$
DECLARE
pOneMinute interval := '1 minute'; --for setting expire
pFoundRecord boolean := false; --if found a record to work with
pExpires aspnet_session.Expires%Type;
BEGIN
--get the values
SELECT Expires, SessionItems, Locked, LockId, LockDate, Flags
INTO pExpires, oSessionItems, oLockedRecord, oLockId, oLockDate, oActionFlags
FROM aspnet_session
WHERE SessionId = iSessionId AND AppId = iAppId;
IF pExpires < CURRENT_TIMESTAMP THEN
oLockedRecord := true; -- can't lock record that should be deleted,
-- so saying somebody else has a lock (time in this case)
DELETE FROM aspnet_session
WHERE SessionId = iSessionId AND AppId = iAppId;
-- still send back items in case of reset session
--pFoundRecord = false; --default is false
oSessionItems:= null; --tell .Net no session found
ELSE
pFoundRecord := true; --found a record that we may locked
END IF;
IF pFoundRecord = true and oLockedRecord = false and iLockRecord THEN
-- found a record that's good
-- its not locked.
-- we want to lock it.
-- we need to bump up the lock id
oLockId := oLockId + 1;
oLockedRecord := true;
oLockDate := CURRENT_TIMESTAMP;
UPDATE aspnet_session
SET LockId = oLockId,
Flags = 0,
Locked = oLockedRecord,
LockDate = oLockDate
WHERE
SessionId = iSessionId
AND AppId = iAppId;
END IF;
-- ResetItemTimeout will update expire
END;
$BODY$
LANGUAGE 'plpgsql' VOLATILE;
ALTER FUNCTION aspnet_session_getsessionstoreitem2(
IN iSessionId aspnet_session.sessionid%TYPE,
IN iAppId aspnet_session.appid%TYPE,
IN iLockRecord boolean,
OUT oLockId aspnet_session.LockId%TYPE,
OUT oLockDate aspnet_session.LockDate%TYPE,
OUT oLockedRecord boolean,
OUT oActionFlags aspnet_session.Flags%TYPE,
OUT oSessionItems aspnet_session.SessionItems%TYPE
)
OWNER TO testsession;
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
A biography in this little spot...sure.
I've worked at GTE HawaiianTel. I've worked at Nuclear Plants. I've worked at Abbott Labs. I've consulted to Ameritech Cellular. I've consulted to Zurich North America. I've consulted to International Truck and Engine. Right now, I've consulted to Wachovia Securities to help with various projects. I've been to SHCDirect and now at Cision.
During this time, I've used all kinds of tools of the trade. Keeping it to the more familier tools, I've used VB3 to VB.NET, ASP to ASP/JAVASCRIPT/XML to ASP.NET. Currently, I'm developing with C# and ASP.NET. I built reports in Access, Excel, Crystal Reports, and Business Objects (including the Universes and ETLS). Been a DBA on SQL Server 4.2 to 2000 and a DBA for Oracle. I've built OLTP databases and DataMarts. Heck, I've even done Documentum. I've been lucky to have created software for the single user to thousands of concurrent users.
I consider myself fortunate to have met many different people and worked in many environments. It's through these experiences I've learned the most.