By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,660 Members | 1,299 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,660 IT Pros & Developers. It's quick & easy.

"Expiring" transactions?

P: n/a
Is there a way to make transaction automatically COMMIT or ROLLBACK after
certain period of time?
I want website visitors to be able to page through search results using
single cursor. Since users can leave the site at any time, I can't know when
to end their transaction.

I guess I can write a broker that gives each user a connection and tracks
when he's gone, performing necessaty cleanup, but isn't there a simplier
way?

Best regards,
Egor Shipovalov.
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 11 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Most web appl servers have settings to do this for you, or APIs you can
use.

e.g. for J2EE see SessionBindingListener

regards

mark

Egor Shipovalov wrote:
Is there a way to make transaction automatically COMMIT or ROLLBACK after
certain period of time?
I want website visitors to be able to page through search results using
single cursor. Since users can leave the site at any time, I can't know when
to end their transaction.

I guess I can write a broker that gives each user a connection and tracks
when he's gone, performing necessaty cleanup, but isn't there a simplier
way?

Best regards,
Egor Shipovalov.
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 11 '05 #2

P: n/a
Egor Shipovalov wrote:
Is there a way to make transaction automatically COMMIT or ROLLBACK after
certain period of time?
I want website visitors to be able to page through search results using
single cursor. Since users can leave the site at any time, I can't know when
to end their transaction.

I guess I can write a broker that gives each user a connection and tracks
when he's gone, performing necessaty cleanup, but isn't there a simplier
way?


We have statement_timeout, but not transaction_timeout.

--
Bruce Momjian | http://candle.pha.pa.us
pg***@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 12 '05 #3

P: n/a
Bruce Momjian wrote:
Egor Shipovalov wrote:
Is there a way to make transaction automatically COMMIT or ROLLBACK after
certain period of time?
I want website visitors to be able to page through search results using
single cursor. Since users can leave the site at any time, I can't know when
to end their transaction.

I guess I can write a broker that gives each user a connection and tracks
when he's gone, performing necessaty cleanup, but isn't there a simplier
way?

We have statement_timeout, but not transaction_timeout.


Could be nice have it, once I forgot to do a commit and I
left my desk, the day after all the DB was hanged by that opened
transaction.

Regards
Gaetano Mendola.

Nov 12 '05 #4

P: n/a
Gaetano Mendola wrote:
Bruce Momjian wrote:
We have statement_timeout, but not transaction_timeout.

Could be nice have it, once I forgot to do a commit and I
left my desk, the day after all the DB was hanged by that opened
transaction.


Probably it could detect idle time and disconnect.. That could be used to roll
back automatically..

Shridhar
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 12 '05 #5

P: n/a
On Thu, 25 Sep 2003, Shridhar Daithankar wrote:
Gaetano Mendola wrote:
Bruce Momjian wrote:
We have statement_timeout, but not transaction_timeout.

Could be nice have it, once I forgot to do a commit and I
left my desk, the day after all the DB was hanged by that opened
transaction.


Probably it could detect idle time and disconnect.. That could be used to roll
back automatically..


I'd be unhappy with the commit part of the original request for commit or
rollback and in the first instance wouldn't this be a candidate for the client
app. to perform?

Obviously the server may not detect if the client just goes away, unless
keepalive is on, but only the client knows that the user isn't waving the mouse
around the screen looking for that bit of information needed to complete the
query underconstruction.
--
Nigel J. Andrews
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 12 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.