Skip to content

Transaction suspend does not delist resources on JBoss [SPR-1206] #5909

@spring-projects-issues

Description

@spring-projects-issues

Dmitri Maximovich opened SPR-1206 and commented

Spring's TransactionProxies behavi inconsistent under WebLogic and JBoss. See attached sources for deatils and test case (SpringTxTest).

Here is a brief explanation of use case:

  • XA DataSource created in App server
  • JtaTransactionManager defined in Spring context
  • BeanA and BeanB deployed with PROPAGATION_REQUIRES_NEW
  • BeanA has DataSource and BeanB injected
  • BeanA creates JDBC Connection from XA DataSource, executes insert into table and calls BeanB passing Connection as parameter of the call
  • BeanB, using Connection passed, executes inserts into (same) table (this is supposed to happen in new transaction)
  • BeanB throws RuntimeException (Spring is supposed to rollback BeanB's transaction)
  • BeanA catches runtime exception from BeanB and ignoring it (so BeanA transaction supposed to finish successully)

Expected result: Table has 1 record in it after test run.
Result under WebLogic: 1 record.
Result under JBoss: 2 records.

No errors in log files, Spring saying that transaction is rolled back:


[txsuspend.spring.BeanA] A: test() begin
[org.springframework.transaction.interceptor.TransactionInterceptor] Getting transaction for txsuspend.spring.IBeanB.test
[org.springframework.transaction.jta.JtaTransactionManager] Using transaction object [org.springframework.transaction.jta.JtaTransactionObject@239525]
[org.springframework.transaction.jta.JtaTransactionManager] Creating new transaction, suspending current one
[org.springframework.transaction.jta.JtaTransactionManager] Suspending JTA transaction
[org.springframework.transaction.support.TransactionSynchronizationManager] Clearing transaction synchronization
[org.springframework.transaction.jta.JtaTransactionManager] Beginning JTA transaction
[org.springframework.transaction.support.TransactionSynchronizationManager] Initializing transaction synchronization
[txsuspend.spring.BeanB] B: test() begin
[txsuspend.spring.BeanB] Throwing exception from B
[org.springframework.transaction.interceptor.RuleBasedTransactionAttribute] Applying rules to determine whether transaction should rollback on java.lang.RuntimeException: test from B
[org.springframework.transaction.interceptor.RuleBasedTransactionAttribute] Winning rollback rule is: null
[org.springframework.transaction.interceptor.RuleBasedTransactionAttribute] No relevant rollback rule found: applying superclass default
[org.springframework.transaction.interceptor.TransactionInterceptor] Invoking rollback for transaction on txsuspend.spring.IBeanB.test due to throwable [java.lang.RuntimeException: test from B]
[org.springframework.transaction.jta.JtaTransactionManager] Triggering beforeCompletion synchronization
[org.springframework.transaction.jta.JtaTransactionManager] Initiating transaction rollback
[org.springframework.transaction.jta.JtaTransactionManager] Rolling back JTA transaction
[org.springframework.transaction.jta.JtaTransactionManager] Triggering afterCompletion synchronization
[org.springframework.transaction.support.TransactionSynchronizationManager] Clearing transaction synchronization
[org.springframework.transaction.jta.JtaTransactionManager] Resuming suspended transaction
[org.springframework.transaction.support.TransactionSynchronizationManager] Initializing transaction synchronization
[org.springframework.transaction.jta.JtaTransactionManager] Resuming JTA transaction
[txsuspend.spring.BeanA] Exception from BeanB cached, ignoring
[txsuspend.spring.BeanA] A: test() done
[org.springframework.transaction.interceptor.TransactionInterceptor] Invoking commit for transaction on txsuspend.spring.IBeanA.test
[org.springframework.transaction.jta.JtaTransactionManager] Triggering beforeCommit synchronization
[org.springframework.transaction.jta.JtaTransactionManager] Triggering beforeCompletion synchronization
[org.springframework.transaction.jta.JtaTransactionManager] Initiating transaction commit
[org.springframework.transaction.jta.JtaTransactionManager] Committing JTA transaction
[org.springframework.transaction.jta.JtaTransactionManager] Triggering afterCompletion synchronization
[org.springframework.transaction.support.TransactionSynchronizationManager] Clearing transaction synchronization



Affects: 1.2.3

Attachments:

Metadata

Metadata

Assignees

Labels

in: dataIssues in data modules (jdbc, orm, oxm, tx)status: declinedA suggestion or change that we don't feel we should currently apply

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions