Results 1 to 2 of 2

Thread: Cannot call commit when using distributed transactions

  1. #1
    Join Date
    May 2007
    Posts
    5

    Default Cannot call commit when using distributed transactions

    I have an application running on Spring/Hibernate and JWS.
    I now have to provide EJBs support apart from the JWS.
    I have written EJB classes (didnt use Spring's EJB though) and added to the application ear and deployed successfully.
    I used application context to get the Spring beans in my EJB.

    When the session bean's transaction attribute is NotSupported it works fine.

    When i use the Required transaction attribute, I get the exception
    Code:
    java.sql.SQLException: Cannot call commit when using distributed transactions
    	at weblogic.jdbc.wrapper.JTAConnection.commit(JTAConnection.java:323)
    	at org.hibernate.transaction.JDBCTransaction.commitAndResetAutoCommit(JDBCTransaction.java:139)
    	at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:115)
    	at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:561)
    	at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:611)
    	at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:581)
    	at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:307)
    	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:117)
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
    	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
    	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:210)
    	at $Proxy111.retrieve(Unknown Source)
    	at com.bofa.crme.gps.codesprocessor.slsb.RetrieveCodesBean.retrieve(RetrieveCodesBean.java:83)
    	at com.bofa.crme.gps.codesprocessor.slsb.RetrieveCodes_lnrnrk_EOImpl.retrieve(RetrieveCodes_lnrnrk_EOImpl.java:60)
    	at com.bofa.crme.gps.codesprocessor.slsb.RetrieveCodes_lnrnrk_EOImpl_WLSkel.invoke(Unknown Source)
    	at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:517)
    	at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:224)
    	at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:407)
    	at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    	at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
    	at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:403)
    	at weblogic.rmi.internal.BasicServerRef.access$300(BasicServerRef.java:56)
    	at weblogic.rmi.internal.BasicServerRef$BasicExecuteRequest.run(BasicServerRef.java:934)
    	at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    	at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
    I understand the transaction Manager that i use (which is Spring/Hibernate) cannot be used with EJBs. How do i change this, so that the existing application does not bomb.

    Thanks
    TT

  2. #2
    Join Date
    Aug 2004
    Location
    Norwalk, CT USA
    Posts
    27

    Default

    Ritesh

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •