[ http://issues.apache.org/jira/browse/GERONIMO-1545?page=all ]
Gianny Damour resolved GERONIMO-1545:
-------------------------------------
Fix Version: 1.0.1
Resolution: Fixed
This is now fixed.
The optional flag <static-sql> can be used to control the way a CMP is
updated. By default, an UPDATE statement is dynamically generated each time
that a CMP needs to be persisted. This statement only updates the columns
which have been updated during the transaction. This strategy avoids
triggers to be incorrectly fired.
When <static-sql> is set, a single UPDATE statement is generated whatever
the CMP fields to be actually updated. This was the previous strategy.
> 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
> Assignee: Gianny Damour
> Priority: Critical
> Fix For: 1.0.1
>
> 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