hi there,
I want to use an Oracle XADatasource with Hibernate and tried this by using:
hibernate.connection.datasource java:/XAOracleDS
instead of:
hibernate.connection.username user
hibernate.connection.password pwd
hibernate.connection.url jdbc:oracle:oci8:@mysid
However, it seems that the PreparedStatements used by Hibernate are no longer of type OraclePreparedStatement which I need to set a parameter for correct Unicode-Support (oraprepstmt.setFormOfUse for NCHAR).
How can I tell the Datasource Configuration in JBoss (oracle-xa-ds.xml) to retain the correct classes of OraclePreparedStatement used by the Oracle driver (oracle.jdbc.driver.OracleDriver).
My current (working) Jboss Oracle XADatasource config:
<xa-datasource>
<jndi-name>XAOracleDS</jndi-name>
<track-connection-by-tx/>
<isSameRM-override-value>false</isSameRM-override-value>
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
<xa-datasource-property name="URL">jdbc:oracle:oci8:@mysid</xa-datasource-property>
<xa-datasource-property name="User">user</xa-datasource-property>
<xa-datasource-property name="Password">pwd</xa-datasource-property>
<!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->
<!--valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name-->
<!-- Checks the Oracle error codes and messages for fatal errors -->
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
<!-- Oracles XA datasource cannot reuse a connection outside a transaction once enlisted in a global transaction and vice-versa -->
<no-tx-separate-pools/>
</xa-datasource>
thanks a lot
johannes