hello,
Tools:
I used Hibernate 3.0.5 with Websphere 6, and Oracle 9i.
hibernate.cfg.xml:
Code:
<hibernate-configuration>
<session-factory name="HibernateSessionFactory">
<property name="hibernate.current_session_context_class">jta</property>
<property name="hibernate.transaction.factory_class">
org.hibernate.transaction.JTATransactionFactory</property>
<property name="jta.UserTransaction">UserTransaction</property>
<property name="hibernate.transaction.manager_lookup_class">
org.hibernate.transaction.WebSphereExtendedJTATransactionLookup</property>
<!--property name="hibernate.cache.provider_class">org.hibernate.cache.TreeCacheProvider</property-->
<property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
<property name="hibernate.cache.region_prefix">hibernate.test</property>
<!--property name="connection.datasource">java:/OracleDS</property-->
<property name="connection.datasource">OracleDS</property>
<property name="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</property>
<property name="hibernate.transaction.flush_before_completion">true</property>
<property name="hibernate.connection.release_mode">auto</property>
<property name="hibernate.transaction.auto_close_session">true</property>
<property name="hibernate.jdbc.batch_versioned_data">true</property>
<property name="hibernate.max_fetch_depth">1</property>
<property name="hibernate.proxool.pool_alias">pool1</property>
<property name="hibernate.jdbc.use_streams_for_binary">true</property>
<property name="hibernate.query.substitutions">true 1, false 0, yes 'Y', no 'N'</property>
<property name="hibernate.show_sql">true</property>
<!-- mapping files -->
<mapping resource="package/Pojo.hbm.xml"/>
<...>
<...>
</session-factory>
</hibernate-configuration>
In my EJB Session / facade (statefull and BMT), i have this method to begin the transaction:
Code:
private void beginUserTransaction(){
try {
context.getUserTransaction().begin();
} catch (NotSupportedException e) {
throw new EJBException("Begin failed: " + e.getMessage());
} catch (SystemException e) {
throw new EJBException("Begin failed: " + e.getMessage());
}
}
Problem: in this method, a NotSupportedException is thrown when i begin the UserTransaction.
Why?
(Tell me if there are not enough information)