Audit-trail engine inner-workings - Mailing list pgsql-general

From Marcelo de Moraes Serpa
Subject Audit-trail engine inner-workings
Date
Msg-id 1e5bcefd0708210732p498995bal2da4ad022dcf7ad0@mail.gmail.com
Whole thread Raw
Responses Re: Audit-trail engine inner-workings  (Ted Byers <r.ted.byers@rogers.com>)
List 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.




  

pgsql-general by date:

Previous
From: hubert depesz lubaczewski
Date:
Subject: Re: Using oid as pkey
Next
From: Ted Byers
Date:
Subject: Re: Audit-trail engine inner-workings