[jboss-jira] [JBoss JIRA] (AS7-3860) HHH00389:Unsuccessful: drop sequence hibernate_sequence
Robb Greathouse (JIRA)
jira-events at lists.jboss.org
Mon Mar 19 13:54:47 EDT 2012
[ https://issues.jboss.org/browse/AS7-3860?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12677760#comment-12677760 ]
Robb Greathouse commented on AS7-3860:
--------------------------------------
I am assuming that the underlying database is Hypersonic? If the persistence.xml or hibernate.cfg.xml file is configured for create-drop
<property name="hbm2ddl.auto">create-drop</property>
Then the entire database will be dropped and re-created. This will resolve the sequence problem. I understand that this is not as "clean" as just dropping a table would seem to be. However, just dropping a table is not a simple in a database as it is often portrayed. For example if the table that is dropped is a foreign key in other tables this can cause lots of problems with referential integrity all over the place. Different databases handle this in different ways. Some will block the dropping of the table and the sequence in order to prevent corruption.
I don't know how Hypersonic works on this level. But from the error message I would guess that the deletion of the table is not complete. The sequence is either not being deleted or more likely is being left in an unusable state, so that a new sequence can not be created.
Dropping and recreating tables is considered a bad practice during normal operations. What is the use case for doing this?
Best practice would be to use a view rather than a table, if it is a temp table.
If it is done during development, you probably want to do a complete database drop and recreate to avoid incomplete drops. Especially, if you are using a database that is not full enterprise as a complete clean-up may not be done.
> HHH00389:Unsuccessful: drop sequence hibernate_sequence
> -------------------------------------------------------
>
> Key: AS7-3860
> URL: https://issues.jboss.org/browse/AS7-3860
> Project: Application Server 7
> Issue Type: Bug
> Components: JPA / Hibernate
> Reporter: Burr Sutter
> Attachments: html5_deploy_server.log
>
>
> Steps
> - Using JBoss Tools nightly http://download.jboss.org/jbosstools/builds/nightly/trunk/latest/all/repo/
> - Pick HTML 5 from JBoss Central
> - Add/Remove to deploy to JBoss Server
> Sequence "HIBERNATE_SEQUENCE" not found; SQL statement:
> drop sequence hibernate_sequence [90036-145]
> Server.log section attached
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list