Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>OK. This is how I solved problem, 1st define tx datasource, 2nd define jta model and jta-datasource in persistence.xml.</p> <p>New datasource definition:</p> <pre><code>&lt;datasources&gt; &lt;xa-datasource&gt; &lt;jndi-name&gt;OracleDS&lt;/jndi-name&gt; &lt;isSameRM-override-value&gt;false&lt;/isSameRM-override-value&gt; &lt;xa-datasource-class&gt;oracle.jdbc.xa.client.OracleXADataSource&lt;/xa-datasource-class&gt; &lt;xa-datasource-property name="URL"&gt;jdbc:oracle:thin:@IP_ADDRESS:1521:inv9i&lt;/xa-datasource-property&gt; &lt;xa-datasource-property name="User"&gt;***&lt;/xa-datasource-property&gt; &lt;xa-datasource-property name="Password"&gt;***&lt;/xa-datasource-property&gt; &lt;exception-sorter-class-name&gt;org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter&lt;/exception-sorter-class-name&gt; &lt;no-tx-separate-pools/&gt; &lt;metadata&gt; &lt;type-mapping&gt;Oracle9i&lt;/type-mapping&gt; &lt;/metadata&gt; &lt;/xa-datasource&gt; </code></pre> <p> jboss:service=TransactionManager </p> <p>new persistence.xml:</p> <pre><code>&lt;persistence version="1.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_1_0.xsd"&gt; &lt;persistence-unit name="myEJB" transaction-type="JTA"&gt; &lt;provider&gt;org.hibernate.ejb.HibernatePersistence&lt;/provider&gt; &lt;jta-data-source&gt;java:OracleDS&lt;/jta-data-source&gt; &lt;class&gt;hr.bel.model.Instrument&lt;/class&gt; &lt;class&gt;hr.bel.model.Order&lt;/class&gt; &lt;class&gt;hr.bel.model.OrderAdditionalData&lt;/class&gt; &lt;class&gt;hr.bel.model.OrderCondition&lt;/class&gt; &lt;class&gt;hr.bel.model.Trade&lt;/class&gt; &lt;class&gt;hr.bel.model.TradeAdditionalData&lt;/class&gt; &lt;class&gt;hr.bel.model.Tradeticker&lt;/class&gt; &lt;properties&gt; &lt;property name="hibernate.dialect" value="org.hibernate.dialect.Oracle9iDialect"/&gt; &lt;property name="hibernate.hbm2ddl.auto" value="none" /&gt; &lt;property name="hibernate.show_sql" value="true" /&gt; &lt;/properties&gt; &lt;/persistence-unit&gt; &lt;/persistence&gt; </code></pre> <p>My java code is same and now I'm getting my object persisted! After discussion with my colleagues who use mysql dbms we figure that Oracle with its tx and no-tx datasources made strict restrictions on how and where datasources will be used. Thank you all!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload