[Rearranged quotes for better readability]

On 2004-10-19 08:23:53 -0600, Reidy, Ron wrote:
> BAXTER, LINCOLN A [mailto:[EMAIL PROTECTED]:
>> Ok, then if you use Apache and mod_perl this should be easy... just open
>> connection if you don't have it (or you get and error on it), and keep it
>> around.
>> 
>> Call commit (even if you have done only selects), at the end of each "event"
>> instead of close. 
> This is an **extremely** bad idea.  A commit() should be issues only
> when necessary - the cost in the database of a commit is large and
> doing so in this random fashion is an invitation to other performance
> problems.

I don't know what lincoln means with "event", but if it is a single http
request, then that is not a "random fashion".

An http request is often naturally a transaction - the user has clicked
on a button or link and expects that to either work or not work, but not
sort-of-work.

Also, in many environments (and I believe, mod_perl is one of them) you
have absolutely no guarantee that two consecutive requests from the same
"session" will get the same database connection at the server - if you
want any changes to be visible from one request to the next you have to
commit at the end of the request.

        hp

-- 
   _  | Peter J. Holzer      | Shooting the users in the foot is bad. 
|_|_) | Sysadmin WSR / LUGA  | Giving them a gun isn't.
| |   | [EMAIL PROTECTED]        |      -- Gordon Schumacher,
__/   | http://www.hjp.at/   |     mozilla bug #84128

Attachment: pgp1W919bE0I3.pgp
Description: PGP signature

Reply via email to