You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Oliver Bayer (JIRA)" <ji...@apache.org> on 2010/08/04 22:15:15 UTC
[jira] Created: (OPENJPA-1760) Should deleteTableContents always
delete really ALL content?
Should deleteTableContents always delete really ALL content?
------------------------------------------------------------
Key: OPENJPA-1760
URL: https://issues.apache.org/jira/browse/OPENJPA-1760
Project: OpenJPA
Issue Type: Question
Affects Versions: 2.0.0
Environment: Win XP, Postgres 8.4, OpenJPA 2.0.0
Reporter: Oliver Bayer
At my usecase not all tables are managed by openjpa so not all of them are listed with the class-tag inside persistence.xml. I set up openjpa to delete the table contents for developping with the following property:
<property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(SchemaAction='add,deleteTableContents')"/>
But now all contents are deleted even the one of tables which aren't listed inside persistence.xml.
Shouldn't openjpa only delete contents from tables which are configured plus the openjpa_sequence_table rather than deleting all contents from the whole database? Is this a bug or is there a property which I have to set to get the described behaviour?
Greets Oli
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (OPENJPA-1760) Should deleteTableContents always
delete really ALL content?
Posted by "Oliver Bayer (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-1760?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12899118#action_12899118 ]
Oliver Bayer commented on OPENJPA-1760:
---------------------------------------
Hi Rick,
once again sorry for not replying for a while.
I've tried to write a test webapp so you can reproduce the error but I couldn't reproduce it on my own :-). Today I found the error. First I used SchemaAction='add,delete....' but for a while I changed to SchemaAction='refresh,delete....'.
So I made a stupid error while creating this ticket in naming the wrong config parameter. Sorry for all the confusion.
You're right: If I use SchemaAction='add,delete....' all is working correctly.
BUT if I use SchemaAction='refresh,delete...' openjpa is deleting all contents of ALL tables in the database.
After comparing both functions (add, refresh) in source code I maybe found the bug.
SchemaTool - void refresh():
Line 378:
SchemaGroup db = getDBSchemaGroup(true);
should be:
SchemaGroup db = getDBSchemaGroup(FALSE);
The add function uses FALSE as parameter too. If I set a breakpoint and change it manually to false openjpa is only deleting content of tables which are defined in persistence.xml so it should work.
I hope you're now able to reproduce the bug and use my suggested bugfix if it doesn't have any sideeffects which I can't overlook. Can you please check it?
Greets Oli
> Should deleteTableContents always delete really ALL content?
> ------------------------------------------------------------
>
> Key: OPENJPA-1760
> URL: https://issues.apache.org/jira/browse/OPENJPA-1760
> Project: OpenJPA
> Issue Type: Question
> Affects Versions: 2.0.0
> Environment: Win XP, Postgres 8.4, OpenJPA 2.0.0
> Reporter: Oliver Bayer
>
> At my usecase not all tables are managed by openjpa so not all of them are listed with the class-tag inside persistence.xml. I set up openjpa to delete the table contents for developping with the following property:
> <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(SchemaAction='add,deleteTableContents')"/>
> But now all contents are deleted even the one of tables which aren't listed inside persistence.xml.
> Shouldn't openjpa only delete contents from tables which are configured plus the openjpa_sequence_table rather than deleting all contents from the whole database? Is this a bug or is there a property which I have to set to get the described behaviour?
> Greets Oli
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (OPENJPA-1760)
SchemaAction='refresh,deleteTableContents' incorrectly removes data from
ALL DB tables.
Posted by "Rick Curtis (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-1760?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Rick Curtis updated OPENJPA-1760:
---------------------------------
Summary: SchemaAction='refresh,deleteTableContents' incorrectly removes data from ALL DB tables. (was: Should deleteTableContents always delete really ALL content?)
Issue Type: Bug (was: Question)
Fix Version/s: 2.1.0
Affects Version/s: 2.1.0
Priority: Minor (was: Major)
Component/s: tooling
> SchemaAction='refresh,deleteTableContents' incorrectly removes data from ALL DB tables.
> ---------------------------------------------------------------------------------------
>
> Key: OPENJPA-1760
> URL: https://issues.apache.org/jira/browse/OPENJPA-1760
> Project: OpenJPA
> Issue Type: Bug
> Components: tooling
> Affects Versions: 2.0.0, 2.1.0
> Environment: Win XP, Postgres 8.4, OpenJPA 2.0.0
> Reporter: Oliver Bayer
> Assignee: Rick Curtis
> Priority: Minor
> Fix For: 2.1.0
>
> Attachments: OPENJPA-1760.patch
>
>
> At my usecase not all tables are managed by openjpa so not all of them are listed with the class-tag inside persistence.xml. I set up openjpa to delete the table contents for developping with the following property:
> <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(SchemaAction='add,deleteTableContents')"/>
> But now all contents are deleted even the one of tables which aren't listed inside persistence.xml.
> Shouldn't openjpa only delete contents from tables which are configured plus the openjpa_sequence_table rather than deleting all contents from the whole database? Is this a bug or is there a property which I have to set to get the described behaviour?
> Greets Oli
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (OPENJPA-1760)
SchemaAction='refresh,deleteTableContents' incorrectly removes data from
ALL DB tables.
Posted by "Rick Curtis (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-1760?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Rick Curtis updated OPENJPA-1760:
---------------------------------
Attachment: OPENJPA-1760_testcase.patch
Removed earlier posted patch as it wasn't the proper change.
Re-posting a patch with the testcase.
> SchemaAction='refresh,deleteTableContents' incorrectly removes data from ALL DB tables.
> ---------------------------------------------------------------------------------------
>
> Key: OPENJPA-1760
> URL: https://issues.apache.org/jira/browse/OPENJPA-1760
> Project: OpenJPA
> Issue Type: Bug
> Components: tooling
> Affects Versions: 2.0.0, 2.1.0
> Environment: Win XP, Postgres 8.4, OpenJPA 2.0.0
> Reporter: Oliver Bayer
> Assignee: Rick Curtis
> Priority: Minor
> Fix For: 2.1.0
>
> Attachments: OPENJPA-1760_testcase.patch
>
>
> At my usecase not all tables are managed by openjpa so not all of them are listed with the class-tag inside persistence.xml. I set up openjpa to delete the table contents for developping with the following property:
> <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(SchemaAction='add,deleteTableContents')"/>
> But now all contents are deleted even the one of tables which aren't listed inside persistence.xml.
> Shouldn't openjpa only delete contents from tables which are configured plus the openjpa_sequence_table rather than deleting all contents from the whole database? Is this a bug or is there a property which I have to set to get the described behaviour?
> Greets Oli
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (OPENJPA-1760) Should deleteTableContents always
delete really ALL content?
Posted by "Oliver Bayer (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-1760?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12907778#action_12907778 ]
Oliver Bayer commented on OPENJPA-1760:
---------------------------------------
Hi,
how do you make progress? Did you find some time for testing the suggested bugfix?
Thanks in advance for the info.
Oli
> Should deleteTableContents always delete really ALL content?
> ------------------------------------------------------------
>
> Key: OPENJPA-1760
> URL: https://issues.apache.org/jira/browse/OPENJPA-1760
> Project: OpenJPA
> Issue Type: Question
> Affects Versions: 2.0.0
> Environment: Win XP, Postgres 8.4, OpenJPA 2.0.0
> Reporter: Oliver Bayer
> Assignee: Rick Curtis
>
> At my usecase not all tables are managed by openjpa so not all of them are listed with the class-tag inside persistence.xml. I set up openjpa to delete the table contents for developping with the following property:
> <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(SchemaAction='add,deleteTableContents')"/>
> But now all contents are deleted even the one of tables which aren't listed inside persistence.xml.
> Shouldn't openjpa only delete contents from tables which are configured plus the openjpa_sequence_table rather than deleting all contents from the whole database? Is this a bug or is there a property which I have to set to get the described behaviour?
> Greets Oli
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (OPENJPA-1760) Should deleteTableContents always
delete really ALL content?
Posted by "Oliver Bayer (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-1760?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12897405#action_12897405 ]
Oliver Bayer commented on OPENJPA-1760:
---------------------------------------
Hi Rick,
first of all, sorry for the late reply.
In the last couple of days I tried to get into writing junit tests but atm I don't have the time to get used to it and write an useful testcase for you to reproduce the problem. So I've coded some console application where openjpa behaves the way it should.
But in my jsf application running in tomcat it always delets all table contents. Therefor I started some debugging session today.
SchemaTool.deleteTableContents()
1) console app: Schema[] schemas (line 421) contains only one scheme named "null".
2) tomcat app: Schema[] schemas (line 421) contains two schemes named "null" and "public".
Null seems to be the correct scheme whereas public always contains all available tables.
Do you know if this occurs because of a misconfiguration or an another error I made?
Regards Oli
> Should deleteTableContents always delete really ALL content?
> ------------------------------------------------------------
>
> Key: OPENJPA-1760
> URL: https://issues.apache.org/jira/browse/OPENJPA-1760
> Project: OpenJPA
> Issue Type: Question
> Affects Versions: 2.0.0
> Environment: Win XP, Postgres 8.4, OpenJPA 2.0.0
> Reporter: Oliver Bayer
>
> At my usecase not all tables are managed by openjpa so not all of them are listed with the class-tag inside persistence.xml. I set up openjpa to delete the table contents for developping with the following property:
> <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(SchemaAction='add,deleteTableContents')"/>
> But now all contents are deleted even the one of tables which aren't listed inside persistence.xml.
> Shouldn't openjpa only delete contents from tables which are configured plus the openjpa_sequence_table rather than deleting all contents from the whole database? Is this a bug or is there a property which I have to set to get the described behaviour?
> Greets Oli
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (OPENJPA-1760)
SchemaAction='refresh,deleteTableContents' incorrectly removes data from
ALL DB tables.
Posted by "Rick Curtis (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-1760?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12918944#action_12918944 ]
Rick Curtis commented on OPENJPA-1760:
--------------------------------------
Oli -
I finally got around to reviewing the suggested code change and I don't think this is the correct direction to go. Yes the change does make the reported problem go away, but there is another big problem that wasn't mentioned.
Per the docs for SchemaTool docs:
* refresh: Equivalent to retain, then add.
* retain: Keep all schema components in the given XML definition, but drop the rest from the database. This action never adds any schema components.
* add: This is the default action if you do not specify one. It brings the schema up-to-date with the given XML document by adding tables, columns, indexes, etc. This action never drops any schema components.
My interpretation of the docs says that retain should drop ALL tables that aren't known to OpenJPA. That isn't happening.
The second problem, and in line with the one you reported is that the 'deleteTableContents' action is defined to only run against OpenJPA known tables. This is a problem with the SchemaTool.getDBSchemaGroup(boolean) method and it caches the value returned even though it is dependent on the value of the provided boolean. This appears to be a large problem that isn't as simple as flipping a single bit. This same problem exists if you were to execute 'add,deleteTableContents', 'createDB,deleteTableContents', etc.... Unfortunately I don't see this being a high enough priority issue to spend any more cycles on. Thanks for the patch and feel free to continue to dig into this issue if you want.
Thanks,
Rick
> SchemaAction='refresh,deleteTableContents' incorrectly removes data from ALL DB tables.
> ---------------------------------------------------------------------------------------
>
> Key: OPENJPA-1760
> URL: https://issues.apache.org/jira/browse/OPENJPA-1760
> Project: OpenJPA
> Issue Type: Bug
> Components: tooling
> Affects Versions: 2.0.0, 2.1.0
> Environment: Win XP, Postgres 8.4, OpenJPA 2.0.0
> Reporter: Oliver Bayer
> Assignee: Rick Curtis
> Priority: Minor
> Fix For: 2.1.0
>
> Attachments: OPENJPA-1760_testcase.patch
>
>
> At my usecase not all tables are managed by openjpa so not all of them are listed with the class-tag inside persistence.xml. I set up openjpa to delete the table contents for developping with the following property:
> <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(SchemaAction='add,deleteTableContents')"/>
> But now all contents are deleted even the one of tables which aren't listed inside persistence.xml.
> Shouldn't openjpa only delete contents from tables which are configured plus the openjpa_sequence_table rather than deleting all contents from the whole database? Is this a bug or is there a property which I have to set to get the described behaviour?
> Greets Oli
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (OPENJPA-1760) Should deleteTableContents always
delete really ALL content?
Posted by "Rick Curtis (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-1760?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12897422#action_12897422 ]
Rick Curtis commented on OPENJPA-1760:
--------------------------------------
Oli -
Could you try swapping out Postgres for MySql or Derby? This might help us narrow down where the problem is. I'll point out that as far as I can tell 'deleteTableContents' doesn't clear out all of my tables when running on MySQL.
Hth,
Rick
> Should deleteTableContents always delete really ALL content?
> ------------------------------------------------------------
>
> Key: OPENJPA-1760
> URL: https://issues.apache.org/jira/browse/OPENJPA-1760
> Project: OpenJPA
> Issue Type: Question
> Affects Versions: 2.0.0
> Environment: Win XP, Postgres 8.4, OpenJPA 2.0.0
> Reporter: Oliver Bayer
>
> At my usecase not all tables are managed by openjpa so not all of them are listed with the class-tag inside persistence.xml. I set up openjpa to delete the table contents for developping with the following property:
> <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(SchemaAction='add,deleteTableContents')"/>
> But now all contents are deleted even the one of tables which aren't listed inside persistence.xml.
> Shouldn't openjpa only delete contents from tables which are configured plus the openjpa_sequence_table rather than deleting all contents from the whole database? Is this a bug or is there a property which I have to set to get the described behaviour?
> Greets Oli
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (OPENJPA-1760)
SchemaAction='refresh,deleteTableContents' incorrectly removes data from
ALL DB tables.
Posted by "Oliver Bayer (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-1760?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12919027#action_12919027 ]
Oliver Bayer commented on OPENJPA-1760:
---------------------------------------
Hi Rick,
thanks for your help and the effort you put into this issue.
Maybe I have to read the spec once again to solve the misunderstanding, sorry for the unusable patch.
I don't know if I get you right but I understand your answer as follows:
- retain: should delete all unknown tables which isn't happening in my testcase
- deleteTableContents: should delete content only from known tables but deletes ALL data
So there are now two bugs than only the one I assumed?
I'm sorry to say but I can't agree with the priority of this issue. I don't want to say anything against your work (don't get me wrong) but if a PERSISTENCE framework accidently remove ALL data it's -if you would ask me- nearly a show-stopper.
I would like to help but if you can't fix it quickly on the fly it would take nearly months to get a valid bugfix :-).
Nevertheless thanks a lot!
Oli
> SchemaAction='refresh,deleteTableContents' incorrectly removes data from ALL DB tables.
> ---------------------------------------------------------------------------------------
>
> Key: OPENJPA-1760
> URL: https://issues.apache.org/jira/browse/OPENJPA-1760
> Project: OpenJPA
> Issue Type: Bug
> Components: tooling
> Affects Versions: 2.0.0, 2.1.0
> Environment: Win XP, Postgres 8.4, OpenJPA 2.0.0
> Reporter: Oliver Bayer
> Priority: Minor
> Fix For: 2.1.0
>
> Attachments: OPENJPA-1760_testcase.patch
>
>
> At my usecase not all tables are managed by openjpa so not all of them are listed with the class-tag inside persistence.xml. I set up openjpa to delete the table contents for developping with the following property:
> <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(SchemaAction='add,deleteTableContents')"/>
> But now all contents are deleted even the one of tables which aren't listed inside persistence.xml.
> Shouldn't openjpa only delete contents from tables which are configured plus the openjpa_sequence_table rather than deleting all contents from the whole database? Is this a bug or is there a property which I have to set to get the described behaviour?
> Greets Oli
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (OPENJPA-1760) Should deleteTableContents always
delete really ALL content?
Posted by "Rick Curtis (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-1760?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12899423#action_12899423 ]
Rick Curtis commented on OPENJPA-1760:
--------------------------------------
Oli -
I took ownership of this JIRA, but just to give you a heads up I probably won't find time to look at it for a couple weeks.
Thanks,
Rick
> Should deleteTableContents always delete really ALL content?
> ------------------------------------------------------------
>
> Key: OPENJPA-1760
> URL: https://issues.apache.org/jira/browse/OPENJPA-1760
> Project: OpenJPA
> Issue Type: Question
> Affects Versions: 2.0.0
> Environment: Win XP, Postgres 8.4, OpenJPA 2.0.0
> Reporter: Oliver Bayer
> Assignee: Rick Curtis
>
> At my usecase not all tables are managed by openjpa so not all of them are listed with the class-tag inside persistence.xml. I set up openjpa to delete the table contents for developping with the following property:
> <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(SchemaAction='add,deleteTableContents')"/>
> But now all contents are deleted even the one of tables which aren't listed inside persistence.xml.
> Shouldn't openjpa only delete contents from tables which are configured plus the openjpa_sequence_table rather than deleting all contents from the whole database? Is this a bug or is there a property which I have to set to get the described behaviour?
> Greets Oli
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (OPENJPA-1760) Should deleteTableContents always
delete really ALL content?
Posted by "Rick Curtis (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-1760?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Rick Curtis reassigned OPENJPA-1760:
------------------------------------
Assignee: Rick Curtis
> Should deleteTableContents always delete really ALL content?
> ------------------------------------------------------------
>
> Key: OPENJPA-1760
> URL: https://issues.apache.org/jira/browse/OPENJPA-1760
> Project: OpenJPA
> Issue Type: Question
> Affects Versions: 2.0.0
> Environment: Win XP, Postgres 8.4, OpenJPA 2.0.0
> Reporter: Oliver Bayer
> Assignee: Rick Curtis
>
> At my usecase not all tables are managed by openjpa so not all of them are listed with the class-tag inside persistence.xml. I set up openjpa to delete the table contents for developping with the following property:
> <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(SchemaAction='add,deleteTableContents')"/>
> But now all contents are deleted even the one of tables which aren't listed inside persistence.xml.
> Shouldn't openjpa only delete contents from tables which are configured plus the openjpa_sequence_table rather than deleting all contents from the whole database? Is this a bug or is there a property which I have to set to get the described behaviour?
> Greets Oli
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (OPENJPA-1760) Should deleteTableContents always
delete really ALL content?
Posted by "Rick Curtis (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-1760?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12896650#action_12896650 ]
Rick Curtis commented on OPENJPA-1760:
--------------------------------------
It sounds like this may be another bug? From the user manual [1] : deleteTableContents: Execute SQL to delete all rows from all tables that OpenJPA knows about.
Could you write a simple unit test that recreates this problem?
Thanks,
Rick
[1] http://openjpa.apache.org/builds/latest/docs/manual/manual.html#ref_guide_schema_schematool
> Should deleteTableContents always delete really ALL content?
> ------------------------------------------------------------
>
> Key: OPENJPA-1760
> URL: https://issues.apache.org/jira/browse/OPENJPA-1760
> Project: OpenJPA
> Issue Type: Question
> Affects Versions: 2.0.0
> Environment: Win XP, Postgres 8.4, OpenJPA 2.0.0
> Reporter: Oliver Bayer
>
> At my usecase not all tables are managed by openjpa so not all of them are listed with the class-tag inside persistence.xml. I set up openjpa to delete the table contents for developping with the following property:
> <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(SchemaAction='add,deleteTableContents')"/>
> But now all contents are deleted even the one of tables which aren't listed inside persistence.xml.
> Shouldn't openjpa only delete contents from tables which are configured plus the openjpa_sequence_table rather than deleting all contents from the whole database? Is this a bug or is there a property which I have to set to get the described behaviour?
> Greets Oli
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (OPENJPA-1760) Should deleteTableContents always
delete really ALL content?
Posted by "Rick Curtis (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-1760?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12908078#action_12908078 ]
Rick Curtis commented on OPENJPA-1760:
--------------------------------------
Oli -
I haven't found any time yet, but hope to shortly here.
Thanks,
Rick
> Should deleteTableContents always delete really ALL content?
> ------------------------------------------------------------
>
> Key: OPENJPA-1760
> URL: https://issues.apache.org/jira/browse/OPENJPA-1760
> Project: OpenJPA
> Issue Type: Question
> Affects Versions: 2.0.0
> Environment: Win XP, Postgres 8.4, OpenJPA 2.0.0
> Reporter: Oliver Bayer
> Assignee: Rick Curtis
>
> At my usecase not all tables are managed by openjpa so not all of them are listed with the class-tag inside persistence.xml. I set up openjpa to delete the table contents for developping with the following property:
> <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(SchemaAction='add,deleteTableContents')"/>
> But now all contents are deleted even the one of tables which aren't listed inside persistence.xml.
> Shouldn't openjpa only delete contents from tables which are configured plus the openjpa_sequence_table rather than deleting all contents from the whole database? Is this a bug or is there a property which I have to set to get the described behaviour?
> Greets Oli
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (OPENJPA-1760) Should deleteTableContents always
delete really ALL content?
Posted by "Oliver Bayer (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-1760?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12916283#action_12916283 ]
Oliver Bayer commented on OPENJPA-1760:
---------------------------------------
Hi Rick,
any updates on your progress?
Greets Oli
> Should deleteTableContents always delete really ALL content?
> ------------------------------------------------------------
>
> Key: OPENJPA-1760
> URL: https://issues.apache.org/jira/browse/OPENJPA-1760
> Project: OpenJPA
> Issue Type: Question
> Affects Versions: 2.0.0
> Environment: Win XP, Postgres 8.4, OpenJPA 2.0.0
> Reporter: Oliver Bayer
> Assignee: Rick Curtis
>
> At my usecase not all tables are managed by openjpa so not all of them are listed with the class-tag inside persistence.xml. I set up openjpa to delete the table contents for developping with the following property:
> <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(SchemaAction='add,deleteTableContents')"/>
> But now all contents are deleted even the one of tables which aren't listed inside persistence.xml.
> Shouldn't openjpa only delete contents from tables which are configured plus the openjpa_sequence_table rather than deleting all contents from the whole database? Is this a bug or is there a property which I have to set to get the described behaviour?
> Greets Oli
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (OPENJPA-1760)
SchemaAction='refresh,deleteTableContents' incorrectly removes data from
ALL DB tables.
Posted by "Rick Curtis (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-1760?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Rick Curtis reassigned OPENJPA-1760:
------------------------------------
Assignee: (was: Rick Curtis)
> SchemaAction='refresh,deleteTableContents' incorrectly removes data from ALL DB tables.
> ---------------------------------------------------------------------------------------
>
> Key: OPENJPA-1760
> URL: https://issues.apache.org/jira/browse/OPENJPA-1760
> Project: OpenJPA
> Issue Type: Bug
> Components: tooling
> Affects Versions: 2.0.0, 2.1.0
> Environment: Win XP, Postgres 8.4, OpenJPA 2.0.0
> Reporter: Oliver Bayer
> Priority: Minor
> Fix For: 2.1.0
>
> Attachments: OPENJPA-1760_testcase.patch
>
>
> At my usecase not all tables are managed by openjpa so not all of them are listed with the class-tag inside persistence.xml. I set up openjpa to delete the table contents for developping with the following property:
> <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(SchemaAction='add,deleteTableContents')"/>
> But now all contents are deleted even the one of tables which aren't listed inside persistence.xml.
> Shouldn't openjpa only delete contents from tables which are configured plus the openjpa_sequence_table rather than deleting all contents from the whole database? Is this a bug or is there a property which I have to set to get the described behaviour?
> Greets Oli
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (OPENJPA-1760) Should deleteTableContents always
delete really ALL content?
Posted by "Rick Curtis (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-1760?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Rick Curtis updated OPENJPA-1760:
---------------------------------
Attachment: OPENJPA-1760.patch
Attaching a testcase and code change suggested by Oliver Bayer.
I was able to recreate the issue and the suggested code change fixed the problem.
> Should deleteTableContents always delete really ALL content?
> ------------------------------------------------------------
>
> Key: OPENJPA-1760
> URL: https://issues.apache.org/jira/browse/OPENJPA-1760
> Project: OpenJPA
> Issue Type: Question
> Affects Versions: 2.0.0
> Environment: Win XP, Postgres 8.4, OpenJPA 2.0.0
> Reporter: Oliver Bayer
> Assignee: Rick Curtis
> Attachments: OPENJPA-1760.patch
>
>
> At my usecase not all tables are managed by openjpa so not all of them are listed with the class-tag inside persistence.xml. I set up openjpa to delete the table contents for developping with the following property:
> <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(SchemaAction='add,deleteTableContents')"/>
> But now all contents are deleted even the one of tables which aren't listed inside persistence.xml.
> Shouldn't openjpa only delete contents from tables which are configured plus the openjpa_sequence_table rather than deleting all contents from the whole database? Is this a bug or is there a property which I have to set to get the described behaviour?
> Greets Oli
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (OPENJPA-1760)
SchemaAction='refresh,deleteTableContents' incorrectly removes data from
ALL DB tables.
Posted by "Rick Curtis (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-1760?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Rick Curtis updated OPENJPA-1760:
---------------------------------
Attachment: (was: OPENJPA-1760.patch)
> SchemaAction='refresh,deleteTableContents' incorrectly removes data from ALL DB tables.
> ---------------------------------------------------------------------------------------
>
> Key: OPENJPA-1760
> URL: https://issues.apache.org/jira/browse/OPENJPA-1760
> Project: OpenJPA
> Issue Type: Bug
> Components: tooling
> Affects Versions: 2.0.0, 2.1.0
> Environment: Win XP, Postgres 8.4, OpenJPA 2.0.0
> Reporter: Oliver Bayer
> Assignee: Rick Curtis
> Priority: Minor
> Fix For: 2.1.0
>
>
> At my usecase not all tables are managed by openjpa so not all of them are listed with the class-tag inside persistence.xml. I set up openjpa to delete the table contents for developping with the following property:
> <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(SchemaAction='add,deleteTableContents')"/>
> But now all contents are deleted even the one of tables which aren't listed inside persistence.xml.
> Shouldn't openjpa only delete contents from tables which are configured plus the openjpa_sequence_table rather than deleting all contents from the whole database? Is this a bug or is there a property which I have to set to get the described behaviour?
> Greets Oli
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.