Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-16864

SQL script executed twice when using persistence.xml jakarta.persistence.sql-load-script-source property

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • None
    • None
    • ---
    • ---

    Description

      I was doing some misc modifications on Quickstarts and noticed that if we add the persistence.xml Jakarta property to execute an SQL script... WFLY tries to execute the script twice, which probably will fail!

      You may use the Kitchensink quickstart to replicate the issue, just add the property as I did at https://github.com/wildfly/quickstart/compare/main...emmartins:quickstart:sqlscriptruntwice?expand=1

      If you run "mvn clean install wildfly:deploy" on /kitchensink with such change you should see this on server log:

      14:56:42,852 INFO  [org.hibernate.tool.schema.internal.SchemaCreatorImpl] (ServerService Thread Pool -- 87) HHH000476: Executing import script 'vfs:/content/kitchensink.war/WEB-INF/classes/import.sql'
      14:56:42,854 INFO  [org.hibernate.tool.schema.internal.SchemaCreatorImpl] (ServerService Thread Pool -- 87) HHH000476: Executing import script 'vfs:/content/kitchensink.war/WEB-INF/classes/import.sql'
      14:56:42,856 WARN  [org.hibernate.tool.schema.internal.ExceptionHandlerLoggedImpl] (ServerService Thread Pool -- 87) GenerationTarget encountered exception accepting command : Error executing DDL "insert into Member (id, name, email, phone_number) values (0, 'John Smith', 'john.smith@mailinator.com', '2125551212')" via JDBC Statement: org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL "insert into Member (id, name, email, phone_number) values (0, 'John Smith', 'john.smith@mailinator.com', '2125551212')" via JDBC Statement
      

      Attachments

        Activity

          People

            smarlow1@redhat.com Scott Marlow
            emartins@redhat.com Eduardo Martins
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: