Hibernate 5 DB2 Column definition XML

Description

When I am using Hibernate 5 with the DB2 column definition XML and I try to persist a entity class into the database I get the following error:

Environment

DB2 Version 11
WebSphere (Integrated Solutions Console, 9.0.0.6)
JAVA JDK 1.8

Activity

Show:
Farzan Modarres Sadeghi
June 19, 2018, 12:36 PM

Hier ist my Persistence.xml:

<?xml version="1.0" encoding="UTF-8"?>

<persistence version="2.0"
xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">

<persistence-unit name="XXX" transaction-type="JTA">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<jta-data-source>jdbc/XXX</jta-data-source>
<class>XXX</class>
<properties>
<property name="hibernate.transaction.jta.platform" value="org.hibernate.engine.transaction.jta.platform.internal.WebSphereExtendedJtaPlatform"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.DB2390Dialect"/>
<property name="javax.persistence.lock.timeout" value="5000"/>
<property name="hibernate.show_sql" value="false"/>
<property name="hibernate.use_sql_comments" value="false"/>
<property name="transaction.manager_lookup_class" value="org.hibernate.transaction.WebSphereTransactionManagerLookup"/>
<property name="transaction.flush_before_completion" value="true"/>
<property name="current_session_context_class" value="jta"/>
<property name="hibernate.transaction.coordinator_class" value="jta"/>

</properties>
</persistence-unit>
</persistence>

Maven dependency:

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>5.3.1.Final</version>
<exclusions>
<exclusion>
<artifactId>jboss-transaction-api_1.2_spec-1.0.0.Final</artifactId>
<groupId>org.jboss.spec.javax.transaction</groupId>
</exclusion>
</exclusions>
</dependency>

Vlad Mihalcea
June 21, 2018, 11:55 AM

You need to add a replication test case as explained in this article.

Assignee

Unassigned

Reporter

Farzan Modarres Sadeghi

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

4.2.21

Components

Affects versions

Priority

Major
Configure