CMP update statements will cause incorrect trigger firing in a database
-----------------------------------------------------------------------
Key: GERONIMO-1545
URL: http://issues.apache.org/jira/browse/GERONIMO-1545
Project: Geronimo
Type: Bug
Versions: 1.0
Reporter: Daniel John Debrunner
Priority: Critical
Regargless of the number of columns modified the UPDATE statement issued to the
database logically updates all columns, though setting unmodified columns to
the same value using the CASE statement. E.g.
UPDATE konto SET erzeugt = CASE WHEN ? THEN ? ELSE erzeugt END, bankname = CASE
WHEN ? THEN ? ELSE bankname END, bankleitzahl = CASE WHEN ? THEN ? ELSE
bankleitzahl END, kontonummer = CASE WHEN ? THEN ? ELSE kontonummer END,
kontostand = CASE WHEN ? THEN ? ELSE kontostand END, fk_person = CASE WHEN ?
THEN ? ELSE fk_person END WHERE guid = ?
This will cause any update triggers to be fired, even those on the un-modified
columns. This, I think, is not the expected behaviour when an application only
modifies, for example, a customer's balance, but the CMP UPDATE will also fire
the send-email on address change trigger.
This form of UPDATE can also be very inefficient on some databases.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira