Audit-trail engine inner-workings

From: "Marcelo de Moraes Serpa" <celoserpa(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Audit-trail engine inner-workings
Date: 2007-08-21 14:32:46
Message-ID: 1e5bcefd0708210732p498995bal2da4ad022dcf7ad0@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello list,

Taking this discussion as a base:

http://archives.postgresql.org/pgsql-general/2007-04/msg01034.php

Manuel helped me to develop an audit-trail engine, and even though it works
ok, I need to know better its inner workings:

From what I understand, the flow is something like this:
* User sends http request to server to update some record (for example);
* The application server (tomcat) runs the servlet and the servlet gets a
connection from the pool
* The servlet runs the "set_session_id(integer)" to set a session for
this request and saves the current application user in the lookup table
(session_id,user_id)
* The db operation is done (db saved) - the user name is retrieved
through a lookup into the table mentioned above by getting this request's
session_id by running the "current_session_id" SP

* Each http request gets an instance of a session_id ? Or is it
per-connection ?
* Do I really need to call reset_session_id ? Isn't this connection
destroyed after it has been used by the application?
* Would it work with an application which does not use a connection pool but
a permanent connection (such as desktop apps)?

Thanks in advance!

Marcelo.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ted Byers 2007-08-21 15:13:27 Re: Audit-trail engine inner-workings
Previous Message JLoz 2007-08-21 14:17:17 problem Linking a TTable component to a pgsql view using BCB5