|
From: Andy D. <an...@ma...> - 2005-10-28 20:33:06
|
I've run into a problem with Spring and JOTM concerning suspending and later resuming a rolled back JOTM transaction. I'm not certain yet if the problem lies in JOTM, Spring, or my usage of Spring. I've created a test that reproduces the problem. See this thread in the forums for full detail, including the test and related files: http://forum.springframework.org/showthread.php?t=19263 I'm using Spring v 1.2.4 and JOTM v. 2.0.10. Should I create a new JIRA issue, or is this just me not using Spring properly? - Andy |
|
From: Thomas R. <tho...@tr...> - 2005-10-28 20:47:22
|
We had similar issues with WebLogic 7 - I'll try your code locally to see if I can reproduce it. You are running this as a standalone app, right? Thomas On Oct 28, 2005, at 4:32 PM, Andy Depue wrote: > I've run into a problem with Spring and JOTM concerning suspending > and later > resuming a rolled back JOTM transaction. I'm not certain yet if > the problem > lies in JOTM, Spring, or my usage of Spring. I've created a test that > reproduces the problem. See this thread in the forums for full > detail, > including the test and related files: > http://forum.springframework.org/showthread.php?t=19263 > I'm using Spring v 1.2.4 and JOTM v. 2.0.10. > Should I create a new JIRA issue, or is this just me not using Spring > properly? > > - Andy > > > ------------------------------------------------------- > This SF.Net email is sponsored by the JBoss Inc. > Get Certified Today * Register for a JBoss Training Course > Free Certification Exam for All Training Attendees Through End of 2005 > Visit http://www.jboss.com/services/certification for more information > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > |
|
From: Andy D. <an...@ma...> - 2005-10-28 21:14:29
|
Yes, except you might want to tweak the DataSource settings to use some test JDBC driver (I happened to use a local PostgreSQL)... anything that would throw a SQLException for a SELECT would work. - Andy On Friday 28 October 2005 01:48 pm, Thomas Risberg wrote: > We had similar issues with WebLogic 7 - I'll try your code locally to > see if I can reproduce it. You are running this as a standalone app, > right? > > Thomas > > On Oct 28, 2005, at 4:32 PM, Andy Depue wrote: > > I've run into a problem with Spring and JOTM concerning suspending > > and later > > resuming a rolled back JOTM transaction. I'm not certain yet if > > the problem > > lies in JOTM, Spring, or my usage of Spring. I've created a test that > > reproduces the problem. See this thread in the forums for full > > detail, > > including the test and related files: > > http://forum.springframework.org/showthread.php?t=19263 > > I'm using Spring v 1.2.4 and JOTM v. 2.0.10. > > Should I create a new JIRA issue, or is this just me not using Spring > > properly? > > > > - Andy |
|
From: Andy D. <an...@ma...> - 2005-10-28 22:23:17
|
I should note that I've just tested this against Spring 1.2.5, which does not change the result in any way. - Andy On Friday 28 October 2005 01:32 pm, Andy Depue wrote: > I've run into a problem with Spring and JOTM concerning suspending and > later resuming a rolled back JOTM transaction. I'm not certain yet if the > problem lies in JOTM, Spring, or my usage of Spring. I've created a test > that reproduces the problem. See this thread in the forums for full > detail, including the test and related files: > http://forum.springframework.org/showthread.php?t=19263 > I'm using Spring v 1.2.4 and JOTM v. 2.0.10. > Should I create a new JIRA issue, or is this just me not using Spring > properly? > > - Andy > > > ------------------------------------------------------- > This SF.Net email is sponsored by the JBoss Inc. > Get Certified Today * Register for a JBoss Training Course > Free Certification Exam for All Training Attendees Through End of 2005 > Visit http://www.jboss.com/services/certification for more information > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Juergen H. <ju...@in...> - 2005-10-29 14:12:20
|
Hi Andy, I do not expect this behavior to change between different Spring versions. The problem rather lies in the semantics of JOTM's "TransactionManager.resume()" operation, which does seem to throw an exception if the transaction to resume has already been marked for rollback. Unfortunately, the JTA spec is not clear on how that operation should behave in such a case; as a consequence, JTA providers differ in that respect. As Thomas says, we know that issue from WebLogic, where the JTA "TransactionManager.resume()" operation has the same semantics. WebLogic provides a separate "forceResume()" operation (on its extended TransactionManager interface) that will also resume a transaction that has already been marked for rollback. We simply provide a special WebLogicJtaTransactionManager now (a subclass of our standard JtaTransactionManager), calling WebLogic's "forceResume()" and also providing a couple of WebLogic-specific extensions. This works nicely on both WebLogic 8.1+ and 7.0 now. I guess we will have to provide such a special JtaTransactionManager for JOTM as well then. However, it's not clear to me what such a special JotmJtaTransactionManager would have to do to enforce a resume. There doesn't seem to be a "forceResume"-style method anywhere in the JOTM API. It might be worthwhile to check out Jonas's usage of JOTM: The Jonas EJB container essentially has the same requirement, needing to enforce a resume of a transaction. I would appreciate any help in finding out how to achieve this. Juergen -----Original Message----- From: spr...@li... [mailto:spr...@li...] On Behalf Of Andy Depue Sent: Saturday, October 29, 2005 12:23 AM To: spr...@li... Subject: Re: [Springframework-developer] Bug in suspend/resume of rolled back transaction wih JOTM? I should note that I've just tested this against Spring 1.2.5, which does not change the result in any way. - Andy On Friday 28 October 2005 01:32 pm, Andy Depue wrote: > I've run into a problem with Spring and JOTM concerning suspending and > later resuming a rolled back JOTM transaction. I'm not certain yet if > the problem lies in JOTM, Spring, or my usage of Spring. I've created > a test that reproduces the problem. See this thread in the forums for > full detail, including the test and related files: > http://forum.springframework.org/showthread.php?t=19263 > I'm using Spring v 1.2.4 and JOTM v. 2.0.10. > Should I create a new JIRA issue, or is this just me not using Spring > properly? > > - Andy > > > ------------------------------------------------------- > This SF.Net email is sponsored by the JBoss Inc. > Get Certified Today * Register for a JBoss Training Course Free > Certification Exam for All Training Attendees Through End of 2005 > Visit http://www.jboss.com/services/certification for more information > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer ------------------------------------------------------- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Andy D. <an...@ma...> - 2005-10-31 16:46:46
|
On Saturday 29 October 2005 07:12 am, Juergen Hoeller wrote: > Hi Andy, > > However, it's not clear to me what such a special JotmJtaTransactionManager > would have to do to enforce a resume. There doesn't seem to be a > "forceResume"-style method anywhere in the JOTM API. It might be worthwhile > to check out Jonas's usage of JOTM: The Jonas EJB container essentially has > the same requirement, needing to enforce a resume of a transaction. I would > appreciate any help in finding out how to achieve this. > Thanks for your help, Juergen! I've posted a message to the JOTM list (about the issue), and another inquiry to the Jonas list asking how they handle this case. I'll try to dig around Jonas source, time permitting. Thanks, Andy |
|
From: Andy D. <an...@ma...> - 2005-11-01 16:38:22
|
On Saturday 29 October 2005 07:12 am, Juergen Hoeller wrote: > ... > However, it's not clear to me what such a special JotmJtaTransactionManager > would have to do to enforce a resume. There doesn't seem to be a > "forceResume"-style method anywhere in the JOTM API. It might be worthwhile > to check out Jonas's usage of JOTM: The Jonas EJB container essentially has > the same requirement, needing to enforce a resume of a transaction. I would > appreciate any help in finding out how to achieve this. I've received some initial feedback from JOTM and Jonas developers, and they say that for JOTM, you can choose to ignore the RollbackException at the point of "resume" to achieve a forced resume (they said that the RollbackException is recoverable at this point, and the transaction should still properly rollback when it is finished). However, they are aware of a bug in which only the first XA resource is re-enlisted with the transaction at resume (because it is after the first "enlist" operation that the RollbackException is thrown, thus causing their enlist loop to abort). They are planning on patching this soon. - Andy |
|
From: Thomas R. <tho...@tr...> - 2005-11-01 16:57:49
|
Andy, From what I can tell we get a SystemException on the resume call. If I trap that exception I get a subsequent RollbackException during the final commit processing of the JTA transaction. I'm not sure what the proper semantics are here, but I don't think this matches at all what we have seen from other JTA implementations. I know I did not see any of these exceptions using WebLogic in a similar situation with a suspended transaction being resumed. Thomas On Nov 1, 2005, at 11:38 AM, Andy Depue wrote: > On Saturday 29 October 2005 07:12 am, Juergen Hoeller wrote: > >> ... >> However, it's not clear to me what such a special >> JotmJtaTransactionManager >> would have to do to enforce a resume. There doesn't seem to be a >> "forceResume"-style method anywhere in the JOTM API. It might be >> worthwhile >> to check out Jonas's usage of JOTM: The Jonas EJB container >> essentially has >> the same requirement, needing to enforce a resume of a >> transaction. I would >> appreciate any help in finding out how to achieve this. >> > > I've received some initial feedback from JOTM and Jonas developers, > and they > say that for JOTM, you can choose to ignore the RollbackException > at the > point of "resume" to achieve a forced resume (they said that the > RollbackException is recoverable at this point, and the transaction > should > still properly rollback when it is finished). However, they are > aware of a > bug in which only the first XA resource is re-enlisted with the > transaction > at resume (because it is after the first "enlist" operation that the > RollbackException is thrown, thus causing their enlist loop to > abort). They > are planning on patching this soon. > > - Andy > > > ------------------------------------------------------- > SF.Net email is sponsored by: > Tame your development challenges with Apache's Geronimo App Server. > Download > it for free - -and be entered to win a 42" plasma tv or your very own > Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > |
|
From: Juergen H. <ju...@in...> - 2005-11-03 13:23:17
|
Actually, a RollbackException on the final commit might be appropriate, if the transaction has been marked as rollback-only by some process outside the application, with the application nevertheless invoking commit rather than rollback. It simply indicates that the commit did not succeed, at the appropriate place: that is, at transaction completion. However, we'd of course have to explicitly clarify what kind of Exception "resume" might throw that we can recover from. "TransactionManager.resume" doesn't declare a RollbackException, so it would - generally - have to be an InvalidTransactionException, IllegalStateException or SystemException. If it's a SystemException in case of JOTM, that's of course not particularly expressive... Juergen -----Original Message----- From: spr...@li... [mailto:spr...@li...] On Behalf Of Thomas Risberg Sent: Tuesday, November 01, 2005 5:59 PM To: spr...@li... Subject: Re: [Springframework-developer] Bug in suspend/resume of rolled back transaction wih JOTM? Andy, From what I can tell we get a SystemException on the resume call. If I trap that exception I get a subsequent RollbackException during the final commit processing of the JTA transaction. I'm not sure what the proper semantics are here, but I don't think this matches at all what we have seen from other JTA implementations. I know I did not see any of these exceptions using WebLogic in a similar situation with a suspended transaction being resumed. Thomas On Nov 1, 2005, at 11:38 AM, Andy Depue wrote: > On Saturday 29 October 2005 07:12 am, Juergen Hoeller wrote: > >> ... >> However, it's not clear to me what such a special >> JotmJtaTransactionManager would have to do to enforce a resume. There >> doesn't seem to be a "forceResume"-style method anywhere in the JOTM >> API. It might be worthwhile to check out Jonas's usage of JOTM: The >> Jonas EJB container essentially has the same requirement, needing to >> enforce a resume of a transaction. I would appreciate any help in >> finding out how to achieve this. >> > > I've received some initial feedback from JOTM and Jonas developers, > and they say that for JOTM, you can choose to ignore the > RollbackException at the point of "resume" to achieve a forced resume > (they said that the RollbackException is recoverable at this point, > and the transaction should still properly rollback when it is > finished). However, they are aware of a bug in which only the first > XA resource is re-enlisted with the transaction at resume (because it > is after the first "enlist" operation that the RollbackException is > thrown, thus causing their enlist loop to abort). They are planning > on patching this soon. > > - Andy > > > ------------------------------------------------------- > SF.Net email is sponsored by: > Tame your development challenges with Apache's Geronimo App Server. > Download > it for free - -and be entered to win a 42" plasma tv or your very own > Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > ------------------------------------------------------- SF.Net email is sponsored by: Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Andy D. <an...@ma...> - 2005-11-03 16:39:29
|
On Thursday 03 November 2005 05:22 am, Juergen Hoeller wrote:
> Actually, a RollbackException on the final commit might be appropriate, if
> the transaction has been marked as rollback-only by some process outside
> the application, with the application nevertheless invoking commit rather
> than rollback. It simply indicates that the commit did not succeed, at the
> appropriate place: that is, at transaction completion.
>
> However, we'd of course have to explicitly clarify what kind of Exception
> "resume" might throw that we can recover from. "TransactionManager.resume"
> doesn't declare a RollbackException, so it would - generally - have to be
> an InvalidTransactionException, IllegalStateException or SystemException.
> If it's a SystemException in case of JOTM, that's of course not
> particularly expressive...
>
> Juergen
Below is the stack trace I'm getting. Your hunch is correct, and it is indeed
throwing a SystemException:
JTA failure on resume; nested exception is javax.transaction.SystemException:
RollbackException in occured in resume() Transaction already marked for
rollback org.springframework.transaction.TransactionSystemException: JTA
failure on resume; nested exception is javax.transaction.SystemException:
RollbackException in occured in resume() Transaction already marked for
rollback
javax.transaction.SystemException: RollbackException in occured in resume()
Transaction already marked for rollback
at org.objectweb.jotm.Current.resume(Current.java:786)
at
org.springframework.transaction.jta.JtaTransactionManager.doJtaResume(JtaTransactionManager.java:769)
at
org.springframework.transaction.jta.JtaTransactionManager.doResume(JtaTransactionManager.java:741)
at
org.springframework.transaction.support.AbstractPlatformTransactionManager.resume(AbstractPlatformTransactionManager.java:432)
at
org.springframework.transaction.support.AbstractPlatformTransactionManager.cleanupAfterCompletion(AbstractPlatformTransactionManager.java:755)
at
org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:536)
at
org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:468)
at
org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:126)
at com.marathon.JotmTest$1.doInTransactionWithoutResult(JotmTest.java:71)
at
org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:33)
at
org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:114)
at
com.marathon.JotmTest.testSuspendAndResumeOfRollbackOnlyTransactionWithEnslistedResource(JotmTest.java:57)
This certainly complicates things. :(
- Andy
|