-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: No way to make hibernate work with WebSphere 6 Datasource
PostPosted: Mon May 18, 2009 1:08 pm 
Newbie

Joined: Mon May 18, 2009 10:25 am
Posts: 2
Hi there,

We have develop an application using hibernate+Oracle 10G for persistent model and WebSphere 6.0.2.23 for the business layer (EJB 2.1)

It works fine in "direct" JDBC mode, with embedded pool and also with c3p0.

Problems arise when we try to delegate the pool in WAS going through a Datasource.

These are the configs we are working with:

JTA Mode

cfg file:

...
<property name="connection.datasource">jdbc/ZB/DS/Oracle</property>
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property> <property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.WebSphereExtendedJTATransactionLookup</property>

<property name="hibernate.max_fetch_depth">2</property>
<property name="hibernate.jdbc.fetch_size">100</property>
<property name="hibernate.default_batch_fetch_size">100</property>
<property name="hibernate.jdbc.use_streams_for_binary">true</property>
<property name="hibernate.connection.aggressive_release">true</property>
<property name="hibernate.cglib.use_reflection_optimizer">true</property>
<property name="hibernate.jdbc.wrap_result_sets">true</property>
<property name="hibernate.show_sql">false</property>
<property name="hibernate.format_sql">false</property>
<property name="hibernate.use_sql_comments">false</property>
<property name="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</property>

...

Results:

Application crashes after hbm mapping:

org.hibernate.TransactionException: could not register synchronization with JTA TransactionManager
at org.hibernate.jdbc.JDBCContext.registerSynchronizationIfPossible(JDBCContext.java:181)
at org.hibernate.jdbc.JDBCContext.<init>(JDBCContext.java:76)
at org.hibernate.impl.SessionImpl.<init>(SessionImpl.java:213)
at org.hibernate.impl.SessionFactoryImpl.openSession(SessionFactoryImpl.java:527)
at org.hibernate.context.JTASessionContext.buildOrObtainSession(JTASessionContext.java:114)
at org.hibernate.context.JTASessionContext.currentSession(JTASessionContext.java:80)
at org.hibernate.impl.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:544)


CMT Mode

cfg file:

...
<property name="connection.datasource">jdbc/ZB/DS/Oracle</property>
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.CMTTransactionFactory</property> <property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.WebSphereExtendedJTATransactionLookup</property>

<property name="hibernate.max_fetch_depth">2</property>
<property name="hibernate.jdbc.fetch_size">100</property>
<property name="hibernate.default_batch_fetch_size">100</property>
<property name="hibernate.jdbc.use_streams_for_binary">true</property>
<property name="hibernate.connection.aggressive_release">true</property>
<property name="hibernate.cglib.use_reflection_optimizer">true</property>
<property name="hibernate.jdbc.wrap_result_sets">true</property>
<property name="hibernate.show_sql">false</property>
<property name="hibernate.format_sql">false</property>
<property name="hibernate.use_sql_comments">false</property>
<property name="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</property>

...

Results:

Application crashes after every saveOrUpdate () operation:

java.lang.unsupportedoperationexception
at WebSphereExtendedJTATransactionLookup.setRollbackOnly


Other things we have tried

-Different Oracle drivers (classes12, ojdbc14...)
-Using the former transaction manager class (WebSphereTransactionManagerLookup)

We have spent some days looking for answers around the forums and we have done no progress. Any idea is welcome.

Thank you for your time.

Regards,

Iñaki


Top
 Profile  
 
 Post subject: Re: No way to make hibernate work with WebSphere 6 Datasource
PostPosted: Tue May 19, 2009 9:50 am 
Regular
Regular

Joined: Wed Mar 23, 2005 8:43 am
Posts: 105
Location: Moscow, Russia
This issue have been already arisen several times on this forum, but we haven't got any answer.

Have a look at this thread and my message at the bottom.

As temporary solution, try to use new WebSphere UOW API, which have been already introduced in Spring Framework (see org.springframework.transaction.jta.WebSphereUowTransactionManager).

_________________
Best Regards


Top
 Profile  
 
 Post subject: Re: No way to make hibernate work with WebSphere 6 Datasource
PostPosted: Wed May 20, 2009 6:29 am 
Newbie

Joined: Mon May 18, 2009 10:25 am
Posts: 2
Thank you for your comment.

We will try your proposal.

Regards,

Iñaki


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.