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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0031712
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] Y. DBSourceManagerminorhave not tried2015-12-15 10:242016-03-17 10:55
ReporterAugustoMauchView Statuspublic 
Assigned ToAugustoMauch 
PrioritynormalResolutionfixedFixed in Version3.0PR16Q2
StatusclosedFix in branchFixed in SCM revisionb80096ac8943
ProjectionnoneETAnoneTarget Version3.0PR16Q2
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

0031712: Open dbsourcemanager API to allow enabling/disabling the foreign keys and constraints of particular tables

DescriptionThe database replication module needs at times to reload the synchronized tables. When a table is reloaded, it needs to drop its foreign keys and constraints to prevent errors when importing.

Currently there are no public methods to do this. In the Platform interface there are methods that do this for the whole database or for a particular dataset, but not one for individual tables.
Steps To Reproduce-
Proposed SolutionAdd to the org.apache.ddlutils.Platform interface methods to enable and disable foreign keys and constraints for individual tables.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0032553 closedAugustoMauch It is not possible to reenable the constraints of a given table 

-  Notes
(0083731)
hgbot (developer)
2016-01-29 14:24

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

Fixes issue 31712: Foreign keys and constraints can be disabled per table

Before this change the Platform class only offered methods to disable all the constraints and foreign keys of the whole database. Now it is possible to do it also on a table to table basis.

Changes done:
- Platform.java: Added public methods disableAllFkForTable, enableAllFkForTable, disableCheckConstraintsForTable, enableCheckConstraintsForTable
- PlatformImplBase.java: Provides a functional default implementation for disableCheckConstraintsForTable and enableCheckConstraintsForTable, possible because the .disableAllChecks(table) was already implemented. Also provides an implementation for disableAllFkForTable and enableAllFkForTable that just returns throw new DatabaseOperationException("Error: Operation not supported"), because it needs to be implemented in each specific platform.
- Oracle8Platform and PostgreSqlPlatform: Implementations for disableAllFkForTable and enableAllFkForTable.

---
M src/org/apache/ddlutils/Platform.java
M src/org/apache/ddlutils/platform/PlatformImplBase.java
M src/org/apache/ddlutils/platform/oracle/Oracle8Platform.java
M src/org/apache/ddlutils/platform/postgresql/PostgreSqlPlatform.java
---
(0083732)
hgbot (developer)
2016-01-29 14:24

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

Related with issue 31712: tests fks and constraints can be disabled and enabled

The tests check that the foreign keys and constraints can be disabled and enabled for the whole database and also for a specific table.

---
M src-test/src/org/openbravo/dbsm/test/model/ModelSuite.java
A src-test/model/constraints/TWO_TABLES_WITH_CONSTRAINTS.xml
A src-test/model/foreignKeys/TWO_TABLES_WITH_FOREIGN_KEYS.xml
A src-test/src/org/openbravo/dbsm/test/model/CheckDisableAndEnableForeignKeysAndConstraints.java
---
(0083736)
hgbot (developer)
2016-01-29 14:32

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

Fixes issue 31712: Foreign keys and constraints can be disabled per table

Before this change the Platform class only offered methods to disable all the constraints and foreign keys of the whole database. Now it is possible to do it also on a table to table basis.

Changes done:
- Platform.java: Added public methods disableAllFkForTable, enableAllFkForTable, disableCheckConstraintsForTable, enableCheckConstraintsForTable
- PlatformImplBase.java: Provides a functional default implementation for disableCheckConstraintsForTable and enableCheckConstraintsForTable, possible because the .disableAllChecks(table) was already implemented. Also provides an implementation for disableAllFkForTable and enableAllFkForTable that just returns throw new DatabaseOperationException("Error: Operation not supported"), because it needs to be implemented in each specific platform.
- Oracle8Platform and PostgreSqlPlatform: Implementations for disableAllFkForTable and enableAllFkForTable.

Some tests have been added to check that the foreign keys and constraints can be disabled and enabled for the whole database and also for a specific table.

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

code reviewed + tested
(0085091)
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
2015-12-15 10:24 AugustoMauch New Issue
2015-12-15 10:24 AugustoMauch Assigned To => AugustoMauch
2015-12-15 10:24 AugustoMauch Modules => Core
2015-12-15 10:24 AugustoMauch Triggers an Emergency Pack => No
2015-12-15 10:25 AugustoMauch Status new => scheduled
2015-12-15 10:25 AugustoMauch Target Version => 3.0PR16Q2
2016-01-04 10:51 AugustoMauch Summary Open dbsourcemanager API to allow enabling/disabling the foreign keys and constraints of particular tables => Open dbsourcemanager API to allow enabling/disabling the foreign keys, triggers and constraints of particular tables
2016-01-04 10:51 AugustoMauch Description Updated View Revisions
2016-01-04 10:51 AugustoMauch Proposed Solution updated
2016-01-25 11:00 AugustoMauch Summary Open dbsourcemanager API to allow enabling/disabling the foreign keys, triggers and constraints of particular tables => Open dbsourcemanager API to allow enabling/disabling the foreign keys and constraints of particular tables
2016-01-25 11:01 AugustoMauch Description Updated View Revisions
2016-01-25 11:01 AugustoMauch Proposed Solution updated
2016-01-29 14:17 AugustoMauch Review Assigned To => alostale
2016-01-29 14:24 hgbot Checkin
2016-01-29 14:24 hgbot Note Added: 0083731
2016-01-29 14:24 hgbot Status scheduled => resolved
2016-01-29 14:24 hgbot Resolution open => fixed
2016-01-29 14:24 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/dbsm-main/rev/689cf824c775ff478473090d7a0ee1a2f15fa6ab [^]
2016-01-29 14:24 hgbot Checkin
2016-01-29 14:24 hgbot Note Added: 0083732
2016-01-29 14:32 hgbot Checkin
2016-01-29 14:32 hgbot Note Added: 0083736
2016-01-29 14:32 hgbot Fixed in SCM revision http://code.openbravo.com/erp/devel/dbsm-main/rev/689cf824c775ff478473090d7a0ee1a2f15fa6ab [^] => http://code.openbravo.com/erp/devel/pi/rev/b80096ac894321c09bf620700c255fd3ef9f8890 [^]
2016-02-05 09:02 alostale Note Added: 0083950
2016-02-05 09:02 alostale Status resolved => closed
2016-02-05 09:02 alostale Fixed in Version => 3.0PR16Q2
2016-03-17 10:55 hudsonbot Checkin
2016-03-17 10:55 hudsonbot Note Added: 0085091
2016-03-30 18:26 AugustoMauch Relationship added related to 0032553


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker