[ https://issues.apache.org/jira/browse/OPENJPA-1698?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Rick Curtis updated OPENJPA-1698: --------------------------------- Priority: Minor (was: Major) Component/s: tooling (was: jdbc) Updated component and lowered the priority as there is a workaround for this issue. > SchemaAction=deleteTableContents throws error if table doesn't exist > -------------------------------------------------------------------- > > Key: OPENJPA-1698 > URL: https://issues.apache.org/jira/browse/OPENJPA-1698 > Project: OpenJPA > Issue Type: Bug > Components: tooling > Affects Versions: 2.0.0 > Environment: Win XP, Postgres 8.4, OpenJPA 2.0.0 > Reporter: Oliver Bayer > Priority: Minor > > Hi, > I want to set up my project during development so that all table contents are deleted with the following property in persistence.xml: > > If I start up with an empty database I get the following error: > org.apache.openjpa.persistence.PersistenceException: ERROR: Relation >>openjpa_sequence_table<< doesn't exist. > This error is raised because of the following sql statement: DELETE FROM OPENJPA_SEQUENCE_TABLE. > My suggested solution would be to modify DBDictionary.getDeleteTableContentsSQL so that it only deletes content from a table if the table exists. > DBDictionary: Line 2183 > --------------------------------- > change: deleteSQL.add("DELETE FROM " + toDBName(tables[i].getFullIdentifier())); > to: deleteSQL.add("DELETE FROM " + toDBName(tables[i].getFullIdentifier()) + " IF EXISTS"); > What do you mean: Is this a valid bugfix? I'm looking forward to your responses. > Greets Oli -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.