Announcement Announcement Module
Collapse
No announcement yet.
Error for global transaction using multiple datasources Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error for global transaction using multiple datasources

    Hi All,

    I am using weblogic 10 MP1 for our application servers. the service layer uses EJB 2.1, Spring 1.8 and hibernate 3.0. EJB for remote client, Spring for transaction management and hibernate for db operation. One method calls various different methods inside same data source and one on another datasource If I try to use propagation_requires_new. it works but doesn't manage the second transaction on different datasource. If I use propagation_required or propagation_nested it gives following exception.
    I am using org.springframework.transaction.jta.JtaTransaction Manager as transaction manager.

    I have attached the error and spring.xml in zip file.

    Any help much appreciated.

    Thanks,
    Hemen

    Error:
    Code:
    16:27:28,398 DEBUG SessionFactoryUtils:Opening Hibernate Session
    16:27:28,398 DEBUG SessionFactoryUtils:Registering Spring transaction synchronization for new Hibernate Session
    16:27:28,398 DEBUG TransactionSynchronizationManager:Bound value [org.springframework.orm.hibernate3.SessionHolder@19c1c
    d8] for key [org.hibernate.impl.SessionFactoryImpl@15f5727] to thread [[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.
    kernel.Default (self-tuning)']
    16:27:28,398 DEBUG TransactionSynchronizationManager:Retrieved value [org.springframework.orm.hibernate3.SessionHolder@19c1cd8] for key [org.hibernate.impl.SessionFactoryImpl@15f5727] bound to thread [[ACTIVE] ExecuteThread: '1' for queue:
    'weblogic.kernel.Default (self-tuning)']
    16:27:28,430 WARN JDBCExceptionReporter:SQL Error: 0, SQLState: null
    16:27:28,430 ERROR JDBCExceptionReporter:Connection has already been created in this tx context for pool named test1_ds. Illegal attempt to create connection from another pool: test2_ds
    16:27:28,430 WARN JDBCExceptionReporter:SQL Error: 0, SQLState: null
    16:27:28,430 ERROR JDBCExceptionReporter:Connection has already been created in this tx context for pool named test1_ds. Illegal attempt to create connection from another pool: test2_ds
    16:27:28,430 DEBUG RuleBasedTransactionAttribute:Applying rules to determine whether transaction should rollback on org.
    hibernate.exception.GenericJDBCException: Cannot open connection
    16:27:28,445 DEBUG RuleBasedTransactionAttribute:Winning rollback rule is: null
    16:27:28,445 DEBUG RuleBasedTransactionAttribute:No relevant rollback rule found: applying superclass default
    16:27:28,445 DEBUG TransactionInterceptor:Invoking rollback for transaction on com.ml.gibt.eds.cdw.ods.service.impl.party.IPartyService.createParty due to throwable [org.hibernate.exception.GenericJDBCException: Cannot open connection]
    16:27:28,445 DEBUG JtaTransactionManager:Triggering beforeCompletion synchronization
    16:27:28,445 DEBUG TransactionSynchronizationManager:Removed value [org.springframework.orm.hibernate3.SessionHolder@19c1cd8] for key [org.hibernate.impl.SessionFactoryImpl@15f5727] from thread [[ACTIVE] ExecuteThread: '1' for queue: 'weblo
    gic.kernel.Default (self-tuning)']
    16:27:28,461 DEBUG JtaTransactionManager:Participating transaction failed - marking existing transaction as rollback-only
    16:27:28,461 DEBUG JtaTransactionManager:Setting JTA transaction rollback-only
    16:27:28,461 DEBUG JtaTransactionManager:Registering after-completion synchronization with existing JTA transaction
    16:27:28,461 DEBUG JtaTransactionManager:Participating in existing JTA transaction that has been marked rollback-only: cannot register Spring after-completion callbacks with outer JTA transaction - immediately performing Spring after-completion callbacks with outcome status 'rollback'
    16:27:28,461 DEBUG SessionFactoryUtils:Closing Hibernate Session
    16:27:28,461 DEBUG TransactionSynchronizationManager:Clearing transaction synchronization
    <Dec 15, 2008 4:27:28 PM EST> <Info> <EJB> <BEA-010051> <EJB Exception occurred during invocation from home: 
    	com.ml.gibt.eds.cdw.ods.service.impl.ejb.ODSService_2ballb_HomeImpl@1a3fb76 threw exception: org.hibernate.exception.GenericJDBCException: Cannot open connection 
    	org.hibernate.exception.GenericJDBCException: Cannot open connection
            at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
            at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
            at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
            at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
            at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:420)
            at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
            at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:93)
            at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:86)
            at org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(AbstractBatcher.java:171)
            at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2048)
            at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2421)
            at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:51)
    Last edited by hthacker; Dec 15th, 2008, 05:55 PM.

  • #2
    Hi,

    Did you find a solution ? i have the same kind of problem.

    Comment

    Working...
    X