Thought I'd point out a "gotcha" with the 3.2 data pipelining module.
I noticed when looking through the (virgin, unported) intranet
sources while doing some contract work today that there's at least one
construct like this:
ns_db dml "begin"
dp_process $some_stuff
ns db dml "insert into something values(...some more stuff...)"
ns_db dml "end".
dp_process also uses begin/end to start a transaction. However,
Postgres doesn't support nested transactions. I'm too busy at the
moment to look at the ported version, but if this wasn't caught in
this (or other cases) the second "begin" will cause a warning (?) and
the nested "end" will end the transaction, with the outer "end" giving
a warning (for sure).
It might appear to work but the atomicity intended for the actions
would be demolished by virtue of the first, nested "end" causing the
transaction to end.
My suggestion is to add a flag to dp_process telling it whether or not
it is in a transaction, and to avoid doing the "begin/end" in this
case.
I haven't checked the Oracle driver to see if the code actually works
for Oracle, either, I'm a bit suspicious that it might not, it would
have to count begin/end nesting and only set autocommit mode when and
end returns the nest to zero. I could do something like this in the
driver but it seems a bit odd in the general, non-ACS AOLserver/PG
case...
Comments? Dan, did you catch this when you ported intranet and work
around it?
Fortunately, at the moment dp_process is rarely used but I suspect it
will be used very often in the future.