Created attachment 599337 [details] AS Config (the relevant DS is java:/jBPMDS When trying the jBPM console out with EAP6 and MySQL 5.5, I have stumbled into the following exception: Caused by: java.sql.SQLException: Field 'id' doesn't have a default value at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3597) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3529) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1990) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2151) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2625) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2119) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2415) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2333) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2318) at com.mysql.jdbc.jdbc2.optional.PreparedStatementWrapper.executeUpdate(PreparedStatementWrapper.java:875) at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:493) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_03-icedtea] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_03-icedtea] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_03-icedtea] at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_03-icedtea] at org.hibernate.engine.jdbc.internal.proxy.AbstractStatementProxyHandler.continueInvocation(AbstractStatementProxyHandler.java:122) [hibernate-core-4.1.3.Final-redhat-1.jar:4.1.3.Final-redhat-1] ... 75 more Turns out, it is caused by the SessionInfo table, which doesn't have the AUTO_INCREMENT flag set. The exact same codebase works with EAP5, suggesting this must be a difference between JPA1 and JPA2. See attached AS config and persistence.xml.
Created attachment 599338 [details] persistence.xml The persistence.xml exhibiting the issue.
Created attachment 607479 [details] persistence.xml for H2DB The same exception occurs if you use default EAP6 database. I include persistence.xml from business-central.war that is set up to use JPA2 classes. The exact exception is: Caused by: org.h2.jdbc.JdbcSQLException: NULL not allowed for column "ID"; SQL statement: insert into SessionInfo (id, lastModificationDate, rulesByteArray, startDate, OPTLOCK) values (null, ?, ?, ?, ?)
The same exception happens with MS SQL Server 2008 when using Hibernate 4 on EAP 6.0: Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Cannot insert the value NULL into column 'id', table 'dballo01.dbo.SessionInfo'; column does not allow nulls. INSERT fails.
Figured this out, it's basically this, I think: - https://hibernate.onjira.com/browse/HHH-6648 The work-around/fix is to add the following line to your persistence.xml: <property name="hibernate.id.new_generator_mappings" value="false" /> We're making EAP 6 specific wars (console-server, human-task) and the persistence.xml files used in both will include the following: <!-- BZ 841786: AS7/EAP 6/Hib 4 uses new (sequence) generators which seem to cause problems --> <property name="hibernate.id.new_generator_mappings" value="false" />
The jbpm-distribution module now creates gwt-console-server and jbpm-human-task wars for EAP6 (classifier: EE6). Both of these now contain persistence.xml files with the lines mentioned above.
Verifier on 5.3.1.BRMS-ER1 (works with brms-p-5.3.1.ER1-deployable-ee6).
Marked as not needing release notes as deploying to EAP6 isn't supported until 5.3.1