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():
SchemaGroup db = getDBSchemaGroup(true);
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?