The persistence.xml
file requires the inclusion of the eclipselink.target-server
property to fully enable transactional behavior. The persistence.xml
file located at src/main/resources/META-INF
should look like the following:
<?xml version="1.0" encoding="UTF-8"?> <persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"> <persistence-unit name="tttPU" transaction-type="JTA"> <provider> org.eclipse.persistence.jpa.PersistenceProvider </provider> <jta-data-source>jdbc/tasktimetracker</jta-data-source> <exclude-unlisted-classes>false</exclude-unlisted-classes> <properties> <property name="eclipselink.target-server" value="SunAS9"/> <property name="eclipselink.logging.level" value="INFO"/> </properties> </persistence-unit> </persistence>
Without this addition, transactions will not be available in your application. The eclipselink.logging.level
may also be changed to increase or decrease logging output as desired.
18.220.187.223