Saturday, January 21, 2017

How To: Configure JTA Data Source in TopLink persistence.xml

Here is an example of a persistence.xml when using a data source:

<persistence version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
   xmlns="http://java.sun.com/xml/ns/persistence" 
   xsi:schemalocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
  <persistence-unit name="Sample" transaction-type="JTA">
    <description>Attribute Data Store</description>
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    <jta-data-source>jdbc/SampleDataSource</jta-data-source>
    <properties>
      <property name="toplink.logging.level" value="INFO">
    </property></properties>
  </persistence-unit>
</persistence>





Please share your feedback below. Hope you find this helpful!

CaptiveCode


No comments:

Post a Comment