Solucionado (ver solução)
Solucionado
(ver solução)
2
respostas

Não grava no banco. Quando clico no botão para gravar os campos, apenas faz esse "update" no console

16:28:24,598 INFO  [stdout] (default task-1) Hibernate: 
16:28:24,599 INFO  [stdout] (default task-1)     select
16:28:24,599 INFO  [stdout] (default task-1)         next_val as id_val 
16:28:24,599 INFO  [stdout] (default task-1)     from
16:28:24,599 INFO  [stdout] (default task-1)         hibernate_sequence for update
16:28:24,599 INFO  [stdout] (default task-1)             
16:28:24,645 INFO  [stdout] (default task-1) Hibernate: 
16:28:24,646 INFO  [stdout] (default task-1)     update
16:28:24,646 INFO  [stdout] (default task-1)         hibernate_sequence 
16:28:24,646 INFO  [stdout] (default task-1)     set
16:28:24,646 INFO  [stdout] (default task-1)         next_val= ? 
16:28:24,646 INFO  [stdout] (default task-1)     where
16:28:24,646 INFO  [stdout] (default task-1)         next_val=?
  <persistence-unit name="auron-persistence-unit" transaction-type="JTA">
    <description>Forge Persistence Unit</description>
    <provider>org.hibernate.ejb.HibernatePersistence</provider>
    <jta-data-source>java:jboss/datasources/auronDS</jta-data-source>
    <exclude-unlisted-classes>false</exclude-unlisted-classes>
    <properties>
      <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
      <property name="hibernate.show_sql" value="true"/>
      <property name="hibernate.format_sql" value="true"/>
      <property name="hibernate.transaction.flush_before_completion" value="true"/>
      <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect"/>
    </properties>
  </persistence-unit>
<module xmlns="urn:jboss:module:1.1" name="com.mysql">
    <resources>
        <resource-root path="mysql-connector-java-5.1.48-bin.jar"/>    
    </resources>
    <dependencies>
        <module name="javax.api"/>
    </dependencies>
</module>
            <datasources>
                <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true" statistics-enabled="${wildfly.datasources.statistics-enabled:${wildfly.statistics-enabled:false}}">
                    <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
                    <driver>h2</driver>
                    <security>
                        <user-name>sa</user-name>
                        <password>sa</password>
                    </security>
                </datasource>
                <datasource jndi-name="java:jboss/datasources/auronDS" pool-name="auronDS" enabled="true" use-java-context="true">
                    <connection-url>jdbc:mysql://localhost:3306/auron</connection-url>
                    <driver>com.mysql</driver>
                    <pool>
                        <min-pool-size>10</min-pool-size>
                        <max-pool-size>100</max-pool-size>
                        <prefill>true</prefill>
                    </pool>
                    <security>
                        <user-name>root</user-name>
                        <password>masterkey</password>
                    </security>
                </datasource>
                <drivers>
                    <driver name="com.mysql" module="com.mysql">
                        <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
                    </driver>
                    <driver name="h2" module="com.h2database.h2">
                        <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
                    </driver>
                </drivers>
            </datasources>
2 respostas
solução!

Já consegui gravar. Só para esclarecer, ates de eu tentar inserir pelo banco H2 eu já tentei usar o MySQL. Quando eu troquei no "persistence.xml" os dados para o H2 e rodei para cadastrar e fazer o insert pelo H2, a partir daí no MySQL começou a funcionar.

Eu imagino que o H2 poderia estar rodando em memória.