I ausing hibernate 2.1.8 with Bea Weblogic 8 SP4
My config file for my first Database:
<hibernate-configuration>
<session-factory name="mySessionFactory">
<property name="connection.datasource">my dbdata source</property>
<property name="jndi.url">t3://localhost:7001</property>
<property name="jndi.class">weblogic.jndi.WLInitialContextFactory</property>
<property name="hibernate.connection.datasource">jdbc/mydb</property>
<property name="hibernate.dialect">net.sf.hibernate.dialect.Oracle9Dialect</property>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.jdbc.batch_size">0</property>
<property name="hibernate.jdbc.use_streams_for_binary">true</property>
<!-- transactions -->
<property name="hibernate.transaction.factory_class">net.sf.hibernate.transaction.JTATransactionFactory</property>
<property name="hibernate.transaction.manager_lookup_class">net.sf.hibernate.transaction.WeblogicTransactionManagerLookup</property>
<property name="hibernate.jta.UserTransaction">java:javax/transaction/UserTransaction</property>
<!-- /transactions -->
<!-- Types -->
<mapping resource="de/vet/procalc/model/A.hbm.xml"/>
<mapping resource="de/vet/procalc/model/B.hbm.xml"/>
<mapping resource="de/vet/procalc/model/C.hbm.xml"/>
<mapping resource="de/vet/procalc/model/D.hbm.xml"/>
<mapping resource="de/vet/procalc/model/E.hbm.xml"/>
<!-- /Types -->
</session-factory>
</hibernate-configuration>
I am using a similiar config for another database.
I try to query data from both datasources. DataSources are using the Oracle XA-Driver. When hibernate tries to query the data the following
exception occures:
Full stack trace of any exception that occurs:
SQL operations are not allowed with no global transaction by default for XA drivers. If the XA driver supports performing SQL operations with no global transaction, explicitly allow it by setting "SupportsLocalTransaction" JDBC connection pool property to true. In this case, also remember to complete the local transaction before using the connection again for global transaction, else a XAER_OUTSIDE XAException may result. To complete a local transaction, you can either set auto commit to true or call Connection.commit() or Connection.rollback().
I am using a modified HibernateUtil implementation witch holds the configs, session and tx's for all databases.
I am NOT using EJB's. I use Hibernate from within the webcontainer.
I am using Oracle 9i with the latest 10g Driver
|