Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0032011
TypeCategorySeverityReproducibilityDate SubmittedLast Update
feature request[Openbravo ERP] Y. DBSourceManagermajorhave not tried2016-01-26 11:452016-03-17 10:55
ReporterAugustoMauchView Statuspublic 
Assigned ToAugustoMauch 
PrioritynormalResolutionfixedFixed in Version3.0PR16Q2
StatusclosedFix in branchFixed in SCM revision2dd2efccfcc6
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Toalostale
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0032011: Allow to recreate a trigger specifying a list of triggers to follow (only applicable in Oracle)

DescriptionThe trigger execution order is handled differently in Postgres and Oracle:
- Postgres: Triggers are executed alphabetically [1]
- Oracle: From Oracle 11, the order of the triggers can be specified using the FOLLOWS clause [2].

A new development in progress adds triggers to the Openbravo tables. Those triggers must be invoked after the Openbravo triggers of the same type defined in those tables. In Postgres this can be handled by naming properly the new triggers, but in Oracle it is required to recreate the affected OB triggers, adding a FOLLOWS clause to force that they are invoked before the new ones.

This case would be covered if the Platform offered a way to recreate a trigger specifying a list of triggers that should be executed after it.


[1] "If multiple triggers of the same kind are defined for the same event, they will be fired in alphabetical order by name." http://www.postgresql.org/docs/9.4/static/sql-createtrigger.html [^]
[2] http://docs.oracle.com/cd/B28359_01/appdev.111/b28370/create_trigger.htm#CJADJGIF [^]
Steps To Reproduce-
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0083737)
hgbot (developer)
2016-01-29 14:33

Repository: erp/devel/dbsm-main
Changeset: 1f0f7d2678744ee4a80cef520cd821501b304612
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Jan 26 16:26:10 2016 +0100
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/1f0f7d2678744ee4a80cef520cd821501b304612 [^]

Fixes issue 32011: Trigger can be recreated with triggers to follow list (ORA)

Now it is possible to recreate an existing trigger, specifying a list of triggers of the same type that should be invoked before it. This development only affects Oracle database
s, as in postgres the trigger execution order is given by the trigger's name.

The Oracle8Builder has been updated to include a follows clause if the trigger being created must be executed before it. For instance, to create a trigger named TEST_TRIGGER_SECO
ND that must be executed after a trigger called TEST_TRIGGER_FIRST, the builder constructs the following statement:

CREATE TRIGGER TEST_TRIGGER_FIRST
AFTER INSERT OR UPDATE
ON TEST FOR EACH ROW
FOLLOWS TEST_TRIGGER_SECOND
DECLARE
BEGIN
END TEST_TRIGGER_FIRST
;

---
M src/org/apache/ddlutils/Platform.java
M src/org/apache/ddlutils/platform/PlatformImplBase.java
M src/org/apache/ddlutils/platform/SqlBuilder.java
M src/org/apache/ddlutils/platform/oracle/Oracle8Builder.java
M src/org/apache/ddlutils/platform/oracle/Oracle8Platform.java
---
(0083738)
hgbot (developer)
2016-01-29 14:33

Repository: erp/devel/dbsm-main
Changeset: f774e5af33b8bfa70a3698ed785b104596884d0b
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Jan 26 16:34:05 2016 +0100
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/f774e5af33b8bfa70a3698ed785b104596884d0b [^]

Related with issue 32011: Adds test to check the FOLLOWS clause in Oracle

The test checks that a trigger can be recreated in Oracle, providing a list of triggers of the same type that should be invoked before it, and it results on a FOLLOWS clause [1] being added to the trigger.

[1] http://docs.oracle.com/cd/B28359_01/appdev.111/b28370/create_trigger.htm#CJADJGIF [^]

---
M src-test/src/org/openbravo/dbsm/test/model/ModelSuite.java
A src-test/model/triggers/TABLE_WITH_TWO_TRIGGERS.xml
A src-test/src/org/openbravo/dbsm/test/model/CheckFollowsClauseCanBeDefinedInOracleTriggers.java
---
(0083739)
hgbot (developer)
2016-01-29 14:33

Repository: erp/devel/dbsm-main
Changeset: 35c9dae4b4aed97592723b5e12072ed2e9fe4c9c
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Fri Jan 29 14:06:43 2016 +0100
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/35c9dae4b4aed97592723b5e12072ed2e9fe4c9c [^]

Related with issue 32011: Removes extra space after FOLLOWS clause

The CheckFollowsClauseCanBeDefinedInOracleTriggers test has been updated to take into account the extra space removal.

---
M src-test/src/org/openbravo/dbsm/test/model/CheckFollowsClauseCanBeDefinedInOracleTriggers.java
M src/org/apache/ddlutils/platform/oracle/Oracle8Builder.java
---
(0083740)
hgbot (developer)
2016-01-29 14:35

Repository: erp/devel/pi
Changeset: 2dd2efccfcc61f4f933983c9c15c0c79937b503d
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Fri Jan 29 14:31:54 2016 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/2dd2efccfcc61f4f933983c9c15c0c79937b503d [^]

Fixes issue 32011: Trigger can be recreated with triggers to follow list (ORA)

Now it is possible to recreate an existing trigger, specifying a list of triggers of the same type that should be invoked before it. This development only affects Oracle database
s, as in postgres the trigger execution order is given by the trigger's name.

The Oracle8Builder has been updated to include a follows clause if the trigger being created must be executed before it. For instance, to create a trigger named TEST_TRIGGER_SECO
ND that must be executed after a trigger called TEST_TRIGGER_FIRST, the builder constructs the following statement:

CREATE TRIGGER TEST_TRIGGER_FIRST
AFTER INSERT OR UPDATE
ON TEST FOR EACH ROW
FOLLOWS TEST_TRIGGER_SECOND
DECLARE
BEGIN
END TEST_TRIGGER_FIRST
;

---
M src-db/database/lib/dbsourcemanager.jar
---
(0083949)
alostale (manager)
2016-02-05 09:01

code reviewed + tested
(0085092)
hudsonbot (developer)
2016-03-17 10:55

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/b22fb0500156 [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2016-01-26 11:45 AugustoMauch New Issue
2016-01-26 11:45 AugustoMauch Assigned To => AugustoMauch
2016-01-26 11:45 AugustoMauch Modules => Core
2016-01-26 11:45 AugustoMauch Triggers an Emergency Pack => No
2016-01-29 14:17 AugustoMauch Review Assigned To => alostale
2016-01-29 14:33 hgbot Checkin
2016-01-29 14:33 hgbot Note Added: 0083737
2016-01-29 14:33 hgbot Status new => resolved
2016-01-29 14:33 hgbot Resolution open => fixed
2016-01-29 14:33 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/dbsm-main/rev/1f0f7d2678744ee4a80cef520cd821501b304612 [^]
2016-01-29 14:33 hgbot Checkin
2016-01-29 14:33 hgbot Note Added: 0083738
2016-01-29 14:33 hgbot Checkin
2016-01-29 14:33 hgbot Note Added: 0083739
2016-01-29 14:35 hgbot Checkin
2016-01-29 14:35 hgbot Note Added: 0083740
2016-01-29 14:35 hgbot Fixed in SCM revision http://code.openbravo.com/erp/devel/dbsm-main/rev/1f0f7d2678744ee4a80cef520cd821501b304612 [^] => http://code.openbravo.com/erp/devel/pi/rev/2dd2efccfcc61f4f933983c9c15c0c79937b503d [^]
2016-02-05 09:01 alostale Note Added: 0083949
2016-02-05 09:01 alostale Status resolved => closed
2016-02-05 09:01 alostale Fixed in Version => 3.0PR16Q2
2016-03-17 10:55 hudsonbot Checkin
2016-03-17 10:55 hudsonbot Note Added: 0085092


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker