473,396 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

"Expiring" transactions?

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
5 1409
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Leszek Taratuta | last post by:
Hello, I am using the following code to prevent users to see the previous pages: Response.CacheControl = "no-cache"; Response.AddHeader( "Pragma", "no-cache" ); Response.Expires = -1; When...
1
by: Daniel Michaeloff | last post by:
Hi all, I have an application that when finished redirects to a non-ASP.NET app which is choking on a huge ASP.NET session cookie. The cookie "ASP.NET_SessionId" gets transmitted by the browser...
5
by: jensen bredal | last post by:
I need to keep track on user "session data" while still turning session off as i do not want users login to expire? Thanks JB
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.