From: | Tino Wildenhain <tino(at)wildenhain(dot)de> |
---|---|
To: | S Arvind <arvindwill(at)gmail(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Session based transaction!! |
Date: | 2009-12-24 12:51:20 |
Message-ID: | 4B3363C8.2030302@wildenhain.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Hi,
S Arvind schrieb:
> Hi Everyone,
>
> In a web application running in Tomcat and Postgres 8.3 as DB, i need to
> know whether my given task is feasible or not.
> All the db operation which is done by that web application
> must be rollback at the end(session dies) and the DB data must be same
> as the starting stage(of session). Its like virtually placing the data
> for that session alone and rollbacking the db to the template which is
> originally been. So whenever users get in the webapplication, the
> initial data must be the template data only and he can perform any
> operation for which data is visible for that user alone and when the
> users leaves(session destroyed) all the data changed in that time must
> be rollbacked.
>
> I thought this by, When the session created in the application a
> transaction must be started and all the activites must be done on the
> DB, but the transaction will not be commited or rollback across request
> but it must be done across the session. By not destroying the connection
> and using it for all the work done by that session. when session destroy
> we can rollback the entire transaction
>
> Is there any other way to achieve the requirements in postgres.
> Thanks in advance..
Isn't that the default? If not you should handle your database
interaction with some high priority handler which runs first and ends
last in your request and handles all exceptions bubbling from other
activities inside it and does a rollback in this case. (Thats the way
Zope does it - but it has a transaction framework. Not sure if Tomcat
offers the same easy hooks but there should be a way.)
Regards
Tino
From | Date | Subject | |
---|---|---|---|
Next Message | Rajan, Pavithra | 2009-12-24 13:35:10 | Re: How to get a list of tables that have a particular column value? |
Previous Message | Thomas | 2009-12-24 10:24:28 | Re: postgres: writer process,what does this process actually do? |