One embodiment of the present invention provides a system for sharing a security
context between different sessions on a database server. The system operates by
receiving a request at the database server through a database session between the
database server and an application on a database client. The system looks up an
identifier for an application client that was previously associated with the database
session. The system uses this identifier to look up the security context containing
attributes related to the application client within a storage area associated with
the database server. Next, the system performs a database operation to satisfy
the request and in doing so enforces access rights associated with the security
context. In one embodiment of the present invention, the request includes a database
query directed to a database on the database server. In one embodiment of the present
invention, performing the database operation involves modifying the database query
to enforce access rights associated with the security context. In one embodiment
of the present invention, the identifier for the application client identifies
a user of the application that is sending the request to the database server. In
one embodiment of the present invention, the database client is an application
server that is sending the request to the database server, and the identifier for
the application client identifies an application session between the application
on the application server and the client of the application.