Daniel Scheu created MDBUNIT-26:
-----------------------------------
Summary: Allow readOnly flag of db connection to be set for exports
Key: MDBUNIT-26
URL: https://jira.codehaus.org/browse/MDBUNIT-26
Project: Maven DbUnit Plugin
Issue Type: Improvement
Affects Versions: 1.0-beta-3
Reporter: Daniel Scheu
Priority: Minor
Attachments: read_only_for_export_mojo.patch
When creating exports it may happen that the export file contains inconsistent
data, because by default the export will "see" commits of other transaction
while it's running. Consider the following scenario:
There are two tables A and B where A has a foreign key column referencing B.id.
First of all table A is exported.
In the meantime, another transaction deletes some records out of table A and B
and commits these changes.
Finally, table B is exported.
If you try to insert the export again, you may get foreign key constraint
violations, stating that some records in A are referencing records in B that do
not exist. Usually, this shouldn't be a big problem, but there are setups
(large db, slow network, high transaction count) where it may become almost
impossible to get a consistent export.
For me, this problem could be solved by enabling the readOnly flag on the db
connection. This prevents the connection which is used for exporting of
"seeing" any data that was created/updated/deleted by another transaction. I
attached a patch that allows the readOnly-flag to be enabled for exports.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email