Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Failing to manage mix of jdbc and hibernate transaction under Spring

843859Jul 25 2007 — edited Jul 30 2007
Hi
My application has some dynamic tables where we are generating table names and the columns based upon client requirements,for this dynamic tables we are using jdbc and the rest is hibernate .here i am unable to propagate the same transation from hibernate to jdbc.When something fails in middle i am unable to rollback completely , because i am unable to manage a single transaction.The jdbc code is being comitted and hiberbnate rollsback.

I wrap anykind of exception in my custom VAMException
and this is my configuration code

<bean id="utilTransactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref local="utilSessionFactory" />
</property>
</bean>

<bean id="publishratingTarget"
class="com.valuemomentum.plm.rating.publish.PublishRating">
<property name="sessionFactory">
<ref local="utilSessionFactory" />
</property>
</bean>

<bean id="publishratingProxy"
class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager">
<ref local="utilTransactionManager" />
</property>
<property name="target">
<ref local="publishratingTarget" />
</property>
<property name="proxyTargetClass" value="true" />
<property name="transactionAttributes">
<props>
<prop key="*">PROPAGATION_REQUIRED,-VAMException</prop>
</props>
</property>
</bean>


Firstly, can i propagate a single transaction in a mix of jdbc and hibernate
If not possible
any ideal solution for this problem
TNX in adv

Message was edited by:
dee_vam
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 27 2007
Added on Jul 25 2007
4 comments
365 views