Skip to content

WebsphereUowTransactionManager and UOWManager wrap checked exceptions if declared to roll back [SPR-5270] #9943

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spring-projects-issues opened this issue Nov 4, 2008 · 1 comment
Assignees
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

Michael Zilske opened SPR-5270 and commented

In the stack trace below, LockingException is a user defined, non-RuntimeException.
The transformAndAllocateArrangements method is annotated @Transactional(rollbackFor=LockingException.class).

If transformAndAllocateArrangements throws a LockingException.class, its immediate caller does not receive it, but receives a TransactionSystemException, as seen below.

If I remove the rollbackFor declaration, the LockingException is received as expected, but the transaction does not roll back (as expected, but not as desired).

See also the archived forum thread: http://forum.springframework.org/archive/index.php/t-47557.html

Thanks for any help.

[04.11.08 21:06:40:950 CET] 0000004b SystemErr R org.springframework.transaction.TransactionSystemException: UOWManager transaction processing failed; nested exception is com.ibm.wsspi.uow.UOWException: de.ivu.mb.rcl.trafo.LockingException
[04.11.08 21:06:40:950 CET] 0000004b SystemErr R at org.springframework.transaction.jta.WebSphereUowTransactionManager.execute(WebSphereUowTransactionManager.java:259)
[04.11.08 21:06:40:950 CET] 0000004b SystemErr R at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:123)
[04.11.08 21:06:40:950 CET] 0000004b SystemErr R at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
[04.11.08 21:06:40:950 CET] 0000004b SystemErr R at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
[04.11.08 21:06:40:950 CET] 0000004b SystemErr R at $Proxy308.transformAndAllocateArrangements(Unknown Source)
[04.11.08 21:06:40:950 CET] 0000004b SystemErr R at de.ivu.mb.rcl.trafo.PersonnelTransformatorBean.refreshPerson(PersonnelTransformatorBean.java:156)
[04.11.08 21:06:40:950 CET] 0000004b SystemErr R at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[04.11.08 21:06:40:950 CET] 0000004b SystemErr R at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
[04.11.08 21:06:40:950 CET] 0000004b SystemErr R at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[04.11.08 21:06:40:950 CET] 0000004b SystemErr R at java.lang.reflect.Method.invoke(Method.java:618)
[04.11.08 21:06:40:950 CET] 0000004b SystemErr R at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
[04.11.08 21:06:40:950 CET] 0000004b SystemErr R at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at org.springframework.transaction.interceptor.TransactionInterceptor$1.doInTransaction(TransactionInterceptor.java:128)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at org.springframework.transaction.jta.WebSphereUowTransactionManager$UOWActionAdapter.run(WebSphereUowTransactionManager.java:306)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at com.ibm.ws.uow.UOWManagerImpl.runUnderCurrentUOW(UOWManagerImpl.java:1141)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at com.ibm.ws.uow.UOWManagerImpl.runUnderUOW(UOWManagerImpl.java:511)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at org.springframework.transaction.jta.WebSphereUowTransactionManager.execute(WebSphereUowTransactionManager.java:252)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:123)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at $Proxy310.refreshPerson(Unknown Source)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at de.ivu.mb.rcl.trafo.TransformatorBean.refreshPerson(TransformatorBean.java:217)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at java.lang.reflect.Method.invoke(Method.java:618)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:198)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at $Proxy312.refreshPerson(Unknown Source)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at de.ivu.mb.rcl.trafo.ejb.TransformatorFacadeEJB.refreshPerson(TransformatorFacadeEJB.java:62)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at de.ivu.mb.rcl.trafo.ejb.EJSRemoteStatelessTransformatorFacade_8a534f1a.refreshPerson(EJSRemoteStatelessTransformatorFacade_8a534f1a.java:189)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at java.lang.reflect.Method.invoke(Method.java:618)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at com.ibm.rmi.util.ProxyUtil$4.run(ProxyUtil.java:727)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at java.security.AccessController.doPrivileged(AccessController.java:246)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at com.ibm.rmi.util.ProxyUtil.invokeWithClassLoaders(ProxyUtil.java:725)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at com.ibm.CORBA.iiop.ClientDelegate.invoke(ClientDelegate.java:1155)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at $Proxy4.refreshPerson(Unknown Source)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at de.ivu.mb.rcl.trafo.ejb._TransformatorFacade_Stub.refreshPerson(_TransformatorFacade_Stub.java:431)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at java.lang.reflect.Method.invoke(Method.java:618)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at com.ibm.etools.utc.model.ReflectionMethodModel.invoke(ReflectionMethodModel.java:65)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at com.ibm.etools.utc.servlet.InvokeServlet.invoke(InvokeServlet.java:113)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at com.ibm.etools.utc.servlet.InvokeServlet.doPost(InvokeServlet.java:369)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:989)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:501)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:464)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:90)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:744)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1455)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:113)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:454)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:383)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:263)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:743)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)
[04.11.08 21:06:40:965 CET] 0000004b SystemErr R Caused by: com.ibm.wsspi.uow.UOWException: de.ivu.mb.rcl.trafo.LockingException
at com.ibm.ws.uow.UOWManagerImpl.runUnderCurrentUOW(UOWManagerImpl.java:1147)
at com.ibm.ws.uow.UOWManagerImpl.runUnderUOW(UOWManagerImpl.java:511)
at org.springframework.transaction.jta.WebSphereUowTransactionManager.execute(WebSphereUowTransactionManager.java:252)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:123)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy308.transformAndAllocateArrangements(Unknown Source)
at de.ivu.mb.rcl.trafo.PersonnelTransformatorBean.refreshPerson(PersonnelTransformatorBean.java:156)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.doInTransaction(TransactionInterceptor.java:128)
at org.springframework.transaction.jta.WebSphereUowTransactionManager$UOWActionAdapter.run(WebSphereUowTransactionManager.java:306)
at com.ibm.ws.uow.UOWManagerImpl.runUnderCurrentUOW(UOWManagerImpl.java:1141)
at com.ibm.ws.uow.UOWManagerImpl.runUnderUOW(UOWManagerImpl.java:511)
at org.springframework.transaction.jta.WebSphereUowTransactionManager.execute(WebSphereUowTransactionManager.java:252)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:123)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy310.refreshPerson(Unknown Source)
at de.ivu.mb.rcl.trafo.TransformatorBean.refreshPerson(TransformatorBean.java:217)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:198)
at $Proxy312.refreshPerson(Unknown Source)
at de.ivu.mb.rcl.trafo.ejb.TransformatorFacadeEJB.refreshPerson(TransformatorFacadeEJB.java:62)
at de.ivu.mb.rcl.trafo.ejb.EJSRemoteStatelessTransformatorFacade_8a534f1a.refreshPerson(EJSRemoteStatelessTransformatorFacade_8a534f1a.java:189)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at com.ibm.rmi.util.ProxyUtil$4.run(ProxyUtil.java:727)
at java.security.AccessController.doPrivileged(AccessController.java:246)
at com.ibm.rmi.util.ProxyUtil.invokeWithClassLoaders(ProxyUtil.java:725)
at com.ibm.CORBA.iiop.ClientDelegate.invoke(ClientDelegate.java:1155)
at $Proxy4.refreshPerson(Unknown Source)
at de.ivu.mb.rcl.trafo.ejb._TransformatorFacade_Stub.refreshPerson(_TransformatorFacade_Stub.java:431)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at com.ibm.etools.utc.model.ReflectionMethodModel.invoke(ReflectionMethodModel.java:65)
at com.ibm.etools.utc.servlet.InvokeServlet.invoke(InvokeServlet.java:113)
at com.ibm.etools.utc.servlet.InvokeServlet.doPost(InvokeServlet.java:369)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:989)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:501)
at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:464)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:90)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:744)
at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1455)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:113)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:454)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:383)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:263)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:743)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)
Caused by: de.ivu.mb.rcl.trafo.LockingException
at org.springframework.transaction.interceptor.TransactionInterceptor$1.doInTransaction(TransactionInterceptor.java:137)
at org.springframework.transaction.jta.WebSphereUowTransactionManager$UOWActionAdapter.run(WebSphereUowTransactionManager.java:306)
at com.ibm.ws.uow.UOWManagerImpl.runUnderCurrentUOW(UOWManagerImpl.java:1141)
... 72 more


Affects: 2.5.4

Referenced from: commits a25e24f

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

This is addressed in 3.0 M2 now, storing a thrown Exception separately and rethrowing it after the UOWManager call returns. Arguably WebSphere's UOWManager shouldn't wrap such an exception in the first place... But since existing WAS versions already behave that way, we'll need to adapt Spring accordingly.

It would be great if you could give the upcoming 3.0 M2 release a try! Let us know whether it works for you...

Juergen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants