You can subscribe to this list here.
| 2003 |
Jan
|
Feb
(55) |
Mar
(100) |
Apr
(203) |
May
(330) |
Jun
(190) |
Jul
(302) |
Aug
(323) |
Sep
(197) |
Oct
(245) |
Nov
(490) |
Dec
(330) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(194) |
Feb
(400) |
Mar
(416) |
Apr
(415) |
May
(359) |
Jun
(381) |
Jul
(491) |
Aug
(311) |
Sep
(291) |
Oct
(273) |
Nov
(355) |
Dec
(266) |
| 2005 |
Jan
(306) |
Feb
(303) |
Mar
(520) |
Apr
(346) |
May
(255) |
Jun
(221) |
Jul
(171) |
Aug
(247) |
Sep
(147) |
Oct
(125) |
Nov
(165) |
Dec
(65) |
| 2006 |
Jan
(90) |
Feb
(53) |
Mar
(121) |
Apr
(103) |
May
(113) |
Jun
(103) |
Jul
(104) |
Aug
(67) |
Sep
(78) |
Oct
(82) |
Nov
(78) |
Dec
(70) |
| 2007 |
Jan
(77) |
Feb
(76) |
Mar
(63) |
Apr
(30) |
May
(47) |
Jun
(41) |
Jul
(44) |
Aug
(44) |
Sep
(49) |
Oct
(33) |
Nov
(25) |
Dec
(21) |
| 2008 |
Jan
(45) |
Feb
(13) |
Mar
(15) |
Apr
(12) |
May
(9) |
Jun
(33) |
Jul
(30) |
Aug
(7) |
Sep
(20) |
Oct
(17) |
Nov
(20) |
Dec
(10) |
| 2009 |
Jan
(8) |
Feb
(5) |
Mar
(12) |
Apr
(17) |
May
(19) |
Jun
(97) |
Jul
(77) |
Aug
(33) |
Sep
(24) |
Oct
(41) |
Nov
(16) |
Dec
(32) |
| 2010 |
Jan
(24) |
Feb
(14) |
Mar
(50) |
Apr
(71) |
May
(70) |
Jun
(64) |
Jul
(45) |
Aug
(62) |
Sep
(32) |
Oct
(4) |
Nov
(12) |
Dec
(2) |
| 2011 |
Jan
(1) |
Feb
(3) |
Mar
(4) |
Apr
(3) |
May
(6) |
Jun
(1) |
Jul
(4) |
Aug
(3) |
Sep
(4) |
Oct
(6) |
Nov
(3) |
Dec
(3) |
| 2012 |
Jan
(4) |
Feb
(8) |
Mar
(6) |
Apr
(10) |
May
(2) |
Jun
(3) |
Jul
(11) |
Aug
(10) |
Sep
(4) |
Oct
|
Nov
(1) |
Dec
(1) |
| 2013 |
Jan
(4) |
Feb
(1) |
Mar
(9) |
Apr
(1) |
May
(8) |
Jun
(2) |
Jul
(5) |
Aug
(2) |
Sep
|
Oct
(3) |
Nov
(10) |
Dec
(8) |
| 2014 |
Jan
(3) |
Feb
(12) |
Mar
(9) |
Apr
(12) |
May
(2) |
Jun
|
Jul
(3) |
Aug
(1) |
Sep
(1) |
Oct
(4) |
Nov
|
Dec
(2) |
| 2015 |
Jan
(1) |
Feb
(3) |
Mar
(4) |
Apr
(9) |
May
(2) |
Jun
(2) |
Jul
|
Aug
(2) |
Sep
(7) |
Oct
(9) |
Nov
(7) |
Dec
(9) |
| 2016 |
Jan
(7) |
Feb
(5) |
Mar
(5) |
Apr
(5) |
May
(8) |
Jun
(4) |
Jul
(5) |
Aug
(4) |
Sep
(6) |
Oct
(7) |
Nov
(2) |
Dec
(3) |
| 2017 |
Jan
(7) |
Feb
(8) |
Mar
(7) |
Apr
(3) |
May
(4) |
Jun
(3) |
Jul
(5) |
Aug
(8) |
Sep
(4) |
Oct
(2) |
Nov
(3) |
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2019 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2021 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2022 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
| 2024 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2025 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
(2) |
Aug
(5) |
Sep
(2) |
Oct
|
Nov
|
Dec
(1) |
| 2026 |
Jan
(1) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Tim D. <sub...@re...> - 2005-06-24 14:52:10
|
Hi all - I put two issues in JIRA a few weeks ago: Bug SPR-1011 http://opensource.atlassian.com/projects/spring/browse/SPR-1011 Static factory-method instantiated beans can break type-safety. UNRESOLVED 04/Jun/05 04/Jun/05 Bug SPR-1010 http://opensource.atlassian.com/projects/spring/browse/SPR-1010 Instance Factory initialised Beans not created. UNRESOLVED 04/Jun/05 04/Jun/05 The reports included even testcases demonstrating the problems as I saw them. I'm happy to try to work on a "fix" for them if appropriate, but could do with: a) a heads-up as to whether these are indeed problems, or if they are somehow my misunderstandings (I'm pretty new at using Spring) b) some kind of suggestion of where I might look for solutions(having looked at the similar (though not equivalent) tests in the spring-cvs hasn't really helped) If, on the other hand, I'm not posting the problems in a useful format, or whatever, then please let me know. After posting (in JIRA, on springframework-user and in the online forums) and getting nothing, leaves me a bit dispirited - any kind of comment (even very negative) would be more useful. Many thanks Tim Sent this to springframework-developer and springframework-user. Not sure which one this qualifies as. |
|
From: Darren D. <da...@sh...> - 2005-06-24 04:55:44
|
1119588937
FAILED
[junit] ------------- Standard Output ---------------
[junit] StopWatch '': running time (millis) = 43229
[junit] [class org.springframework.aop.framework.OptimizedCglibProxyTests.testManyProxies: create 10000 proxies] took 43229=100%
[junit] ------------- ---------------- ---------------
[junit] Testcase: testDeclaredException took 0.681 sec
[junit] Testcase: testTargetCanGetInvocationEvenIfNoAdviceChain took 0 sec
[junit] Testcase: testExistingProxyChangesTarget took 0.004 sec
[junit] Testcase: testDynamicMethodPointcutThatAppliesStaticallyOnlyToSetters took 0.531 sec
[junit] Testcase: testStaticMethodPointcut took 0.611 sec
[junit] Testcase: testNullConfig took 0.001 sec
[junit] Testcase: testNoTarget took 0 sec
[junit] Testcase: testProtectedMethodInvocation took 0.001 sec
[junit] Testcase: testProxyCanBeClassNotInterface took 0.001 sec
[junit] Testcase: testCglibProxyingGivesMeaningfulExceptionIfAskedToProxyNonvisibleClass took 0.011 sec
[junit] Testcase: testMethodInvocationDuringConstructor took 0.104 sec
[junit] Testcase: testUnadvisedProxyCreationWithCallDuringConstructor took 0.002 sec
[junit] Testcase: testMultipleProxies took 0.216 sec
[junit] Testcase: testWithNoArgConstructor took 0.055 sec
[junit] Testcase: testProxyAProxy took 0.002 sec
[junit] Testcase: testExceptionHandling took 0.061 sec
[junit] Testcase: testWithDependencyChecking took 0.292 sec
[junit] Testcase: testNoInterceptorsAndNoTarget took 0.001 sec
[junit] Testcase: testValuesStick took 0 sec
[junit] Testcase: testManyProxies took 44.793 sec
[junit] FAILED
[junit] Proxy creation was too slow
[junit] junit.framework.AssertionFailedError: Proxy creation was too slow
[junit] at org.springframework.aop.framework.AbstractAopProxyTests.testManyProxies(AbstractAopProxyTests.java:147)
This is an automated mail from one of the SF Compile Farm machines.
The machine name noted in the subject encountered a failure building
or running the Spring test suite. The last few lines of the output
were included for info.
NB: No further mail will be sent from this machine until a
manual reset occurs on the cf-shell machine, although builds will
continue as scheduled.
See http://springframework.sourceforge.net/test/ for further
information.
|
|
From: Andy D. <an...@ma...> - 2005-06-24 01:06:52
|
I've discovered that Spring's PlatformTransactionManager (JTA version in my case) will *always* invoke TransactionSynchronizations when its commit() method is called, even if it is participating in a pre-existing JTA transaction. Is this expected behavior? PlatformTransactionManager's JavaDoc for its "commit" method says, "If the transaction wasn't a new one, omit the commit for proper participation in the surrounding transaction." Which AbstractPlatformTransactionManager does indeed honor - however, it will still call any Spring TransactionSynchronizations against the transaction, as if a commit had been performed anyway. In my case, 3rd party code has started a JTA transaction (not using Spring) and then invoked my Spring based code. My Spring based code relies entirely on Spring for transaction management, and I use TransactionInterceptor around my business interfaces. TranactionInterceptor invokes PlatformTransactionManager, which joins in the already existing JTA transaction (things are going well so far). My code then registers a TransactionSynchronization, assuming that when "afterCompletion" is called on the synchronization that the transaction has been safely committed. However, once my business method exits, TransactionInterceptor will call commit() on PlatformTransactionManager which behaves well and does *not* tell JTA to commit since it had joined an already existing transaction. However, afterCompletion *is* called at this point on my TransactionSynchronization, causing my code to update an external resource as if the transaction is safely committed. However, the actual JTA transaction is still outstanding. What happens in my case is that sometimes the transaction will be rolled back by the 3rd party code, and not only is my TransactionSynchronization never notified, but it also already committed (now invalid) information to an external resource. Based on the description of TransactionSynchronization in Spring, it would seem like a safe assumption that the methods contained therein should track the actual transaction and not just Spring's participation in that transaction. Is this not true? - Andy |
|
From: Rob H. <ro...@ca...> - 2005-06-23 09:51:26
|
Sorry about the ASM thing - the util stuff probably won't be needed in the final cut - I'm just using it for debugging at the moment. I'll commit the util jar for the time being Rob Seth Ladd wrote: >Hello, > >Please add aspectjweaver.jar to eclipse classpath, needed by >spring/sandbox/src/org/springframework/aop/support/aspectj > >Also, org.objectweb.asm.util isn't found, and I can't find a jar for >it inside the spring distro. This is required by >spring/sandbox/src/org/springframework/aop/framework/asm > >Also, the spring/sandbox/src/org/springframework/beans/factory/script >classes need to be updated to reflect the new packages for ASM >utility. Also, can someone add that jar to eclipse classpath? > >BTW, the scripting support is great! > >Thanks, >Seth > > >------------------------------------------------------- >SF.Net email is sponsored by: Discover Easy Linux Migration Strategies >from IBM. Find simple to follow Roadmaps, straightforward articles, >informative Webcasts and more! Get everything you need to get up to >speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click >_______________________________________________ >Springframework-developer mailing list >Spr...@li... >https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > > |
|
From: Seth L. <set...@gm...> - 2005-06-23 08:38:07
|
Hello, Please add aspectjweaver.jar to eclipse classpath, needed by spring/sandbox/src/org/springframework/aop/support/aspectj Also, org.objectweb.asm.util isn't found, and I can't find a jar for it inside the spring distro. This is required by spring/sandbox/src/org/springframework/aop/framework/asm Also, the spring/sandbox/src/org/springframework/beans/factory/script classes need to be updated to reflect the new packages for ASM utility. Also, can someone add that jar to eclipse classpath? BTW, the scripting support is great! Thanks, Seth |
|
From: Juergen H. <ju...@in...> - 2005-06-23 08:33:37
|
Done. -----Original Message----- From: spr...@li... [mailto:spr...@li...] On Behalf = Of Seth Ladd Sent: Thursday, June 23, 2005 10:28 AM To: spr...@li... Subject: [Springframework-developer] removing cayene-nodeps.jar from = eclipse classpath Hello, Can someone remove the cayene-nodeps.jar from the eclipse .classpath = file? Thanks very much, Seth ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id=16492&op=3Dick _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Seth L. <set...@gm...> - 2005-06-23 08:28:14
|
Hello, Can someone remove the cayene-nodeps.jar from the eclipse .classpath file? Thanks very much, Seth |
|
From: Juergen H. <ju...@in...> - 2005-06-23 06:37:17
|
Oops, forgot to remove those alongside the Cayenne support itself... fixed. Juergen -----Original Message----- From: spr...@li... [mailto:spr...@li...] On Behalf Of Rob Harrop Sent: Wednesday, June 22, 2005 12:30 PM To: spr...@li... Subject: [Springframework-developer] Cayenne in Sandbox All, There a bunch of tests in the sandbox for Cayenne ORM support that doesn't seem to exist. Any objections to removing them? Rob -- Rob Harrop Interface21 - Spring Services from the Source http://www.springframework.com ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Keith D. <ke...@in...> - 2005-06-23 02:35:37
|
How come the <lookup-method> element doesn't support inner bean subelements? That makes sense, right? Keith -- Keith Donald Interface21 Principal Consultant http://www.springframework.com <http://www.springframework.com/> |
|
From: <al...@in...> - 2005-06-22 22:31:04
|
View results here -> http://opensource.jteam.nl/build/buildresults/spring?log=log20050623001635Lbuild.289 |
|
From: Thierry T. <te...@ya...> - 2005-06-22 11:59:44
|
Hi, I see in the reference documentation (see section 6.4) that Spring will package some services (like transaction management) as AspectJ aspects. Are there some works on that? Thanks, Thierry Take a look at my blog: http://templth.blogspot.com/ ___________________________________________________________________________ Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger Téléchargez cette version sur http://fr.messenger.yahoo.com |
|
From: Rob H. <rob...@in...> - 2005-06-22 10:29:45
|
All, There a bunch of tests in the sandbox for Cayenne ORM support that doesn't seem to exist. Any objections to removing them? Rob -- Rob Harrop Interface21 - Spring Services from the Source http://www.springframework.com |
|
From: Andy D. <an...@ma...> - 2005-06-21 22:53:27
|
JIRA issue created and a proof-of-concept patch supplied (which happens to fix the issue for me): http://opensource.atlassian.com/projects/spring/browse/SPR-1066 - Andy On Tuesday 21 June 2005 02:34 pm, Juergen Hoeller wrote: > Sounds plausible - thanks for tracking this down. Please do create a JIRA > issue for this; I'll fix the issue for Spring 1.2.2. > > Essentially, SpringSessionSynchronization needs to keep a marker that it > has already removed the current Session from the thread, and suppress > suspend and resume accordingly. It could simply hold a boolean flag as > instance variable for this. > > Juergen > |
|
From: Juergen H. <ju...@in...> - 2005-06-21 21:34:18
|
Sounds plausible - thanks for tracking this down. Please do create a =
JIRA
issue for this; I'll fix the issue for Spring 1.2.2.
Essentially, SpringSessionSynchronization needs to keep a marker that it =
has
already removed the current Session from the thread, and suppress =
suspend
and resume accordingly. It could simply hold a boolean flag as instance
variable for this.
Juergen
-----Urspr=FCngliche Nachricht-----
Von: spr...@li...
[mailto:spr...@li...] Im =
Auftrag
von Andy Depue
Gesendet: Dienstag, 21. Juni 2005 23:27
An: spr...@li...
Betreff: Re: [Springframework-developer] Problems with advanced =
transaction
synchronization
As I track this problem further, I see that it lies Hibernate3's=20
SessionFactoryUtils. SessionFactoryUtils has an inner class,=20
"SpringSessionSynchronization", that is instantiated and registered =
against=20
the current transaction when using Spring for session management. =
During=20
transaction suspend and resume, this implementation will *always* call=20
TransactionSynchronizationManager.unbindResource(this.sessionFactory) =
and=20
TransactionSynchronizationManager.bindResource(this.sessionFactory,=20
this.sessionHolder), respectively. When Spring performs a commit, it =
calls=20
synchronization methods in this order:
1. beforeCommit
2. beforeCompletion
3. afterCompletion
In beforeCompletion, SpringSessionSynchronization will=20
unbindResource(this.sessionFactory), and sometimes close the Hibernate=20
Session. However, SpringSessionSynchronization will not reflect this in =
its
internal state in any way. Now imagine that a =
TransactionSynchronization=20
implementation suspends the transaction in afterCompletion. =20
SessionFactoryUtils.SpringSessionSynchronization will have its suspend
method=20
called, which will attempt to unbindResource(this.sessionFactory), =
causing
an=20
exception since it has already been unbound. Moreover, even if it =
performed
a check and did not unbind the resource, resume() would still attempt to =
rebind the resource (whose Hibernate Session was most likely closed in=20
beforeCompletion), leaving that closed resource bound to the current =
thread=20
even after the main transaction has been committed.
Basically, SpringSessionSynchronization needs to be modified to handle =
this=20
call sequence:
1. beforeCommit
2. beforeCompletion
3. suspend
4. resume
5. afterCompletion
Which it does not now support (though this was working in older versions =
of=20
Spring). I'm willing to open a JIRA issue, make these changes, and =
submit a
patch if no one has a problem with them.
- Andy
On Monday 20 June 2005 03:28 pm, Andy Depue wrote:
> I'm attempting to do some advanced transaction synchronization. =
During
> synchronization, I need to update a status row in a DB table. Of =
course,
> since DB access is itself transactional, I create a new transaction =
for
the
> duration of the update using PROPAGATION_REQUIRES_NEW. The problem =
occurs
> when I attempt to execute this in "afterCompletion". I sometimes get =
this
> exception:
> java.lang.IllegalStateException: No value for key
> [org.hibernate.impl.SessionFactoryImpl@1f37bf1] bound to thread =
[Timer-3]
>
> Here is an abbreviated version of my code:
>
> ------------
> TransactionSynchronizationManager.registerSynchronization(new
> TransactionSynchronization() {
>
> public void suspend() { }
> public void resume() { }
> public void beforeCommit(boolean readOnly)
> {
> getTransactionTemplate().execute(new
> TransactionCallbackWithoutResult() {
> protected void doInTransactionWithoutResult(final
> TransactionStatus status) {
> update("update m_t set trans_time=3Dnull where =
trans_id=3D?",
> new Object[] { transId });
> }
> });
> }
> public void beforeCompletion() { }
> public void afterCompletion(final int status) {
> getTransactionTemplate().execute(new
> TransactionCallbackWithoutResult() {
> protected void doInTransactionWithoutResult(final
> TransactionStatus ts) {
> if(status =3D=3D STATUS_ROLLED_BACK) {
> update("update m_t set s_last=3Dtrans_s_start, =
trans_id=3Dnull,
> trans_time=3Dnull where trans_id=3D?",
> new Object[] { transId} );
> } else {
> update("update m_t set trans_id=3Dnull, =
trans_time=3Dnull,
> trans_s_start=3Dnull where trans_id=3D?",
> new Object[] { transId });
> }
> }
> });
> }
> });
> ---------------
>
> The TransactionTemplate returned from getTransactionTemplate() was =
created
> like this:
> transactionTemplate =3D new =
TransactionTemplate(transactionManager);
> =20
>
transactionTemplate.setPropagationBehavior(TransactionDefinition.PROPAGAT=
IO
>N_REQUIRES_NEW);
> transactionTemplate.setTimeout(getTransactionTimeoutInMs());
> transactionTemplate.setReadOnly(false);
>
>
> My question is, should I be able to do this? The exception is not =
thrown
> in many cases - however, in this particular case, an exception was =
thrown
> via other code in the context of the main transaction, though it did =
not
> cause a rollback to occur, so the transaction was in the process of =
being
> committed - and while committing the main transaction, the process of
> starting a new transaction caused this related exception to be thrown.
> This is against Spring 1.2.1.
>
> - Andy
>
> PS. Here is a full stack trace, for what its worth:
> java.lang.IllegalStateException: No value for key
> [org.hibernate.impl.SessionFactoryImpl@1f37bf1] bound to thread =
[Timer-3]
> at
>
org.springframework.transaction.support.TransactionSynchronizationManager=
.u
>nbindResource(TransactionSynchronizationManager.java:175) at
>
org.springframework.orm.hibernate3.SessionFactoryUtils$SpringSessionSynch=
ro
>nization.suspend(SessionFactoryUtils.java:846) at
>
org.springframework.transaction.support.AbstractPlatformTransactionManage=
r.
>suspend(AbstractPlatformTransactionManager.java:350) at
>
org.springframework.transaction.support.AbstractPlatformTransactionManage=
r.
>getExistingTransaction(AbstractPlatformTransactionManager.java:271) at
>
org.springframework.transaction.support.AbstractPlatformTransactionManage=
r.
>getTransaction(AbstractPlatformTransactionManager.java:215) at
>
org.springframework.transaction.support.TransactionTemplate.execute(Trans=
ac
>tionTemplate.java:111) at
> com.marathon.service.dao.jdbc.PSDAO$2.afterCompletion(PSDAO.java:185) =
at
>
org.springframework.transaction.support.AbstractPlatformTransactionManage=
r.
>triggerAfterCompletion(AbstractPlatformTransactionManager.java:610) at
>
org.springframework.transaction.support.AbstractPlatformTransactionManage=
r.
>commit(AbstractPlatformTransactionManager.java:467) at
>
org.springframework.transaction.interceptor.TransactionAspectSupport.doCl=
os
>eTransactionAfterThrowing(TransactionAspectSupport.java:294) at
>
org.springframework.transaction.interceptor.TransactionInterceptor.invoke=
(T
>ransactionInterceptor.java:61) at
>
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refl=
ec
>tiveMethodInvocation.java:144) at
>
net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityIntercept=
or
>.invoke(MethodSecurityInterceptor.java:80) at
>
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refl=
ec
>tiveMethodInvocation.java:144) at
>
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAop=
Pr
>oxy.java:174) at $Proxy58.postApproved(Unknown Source)
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
> from IBM. Find simple to follow Roadmaps, straightforward articles,
> informative Webcasts and more! Get everything you need to get up to
> speed, fast. =
http://ads.osdn.com/?ad_id=3D7477&alloc_id=3D16492&op=3Dclick
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. =
http://ads.osdn.com/?ad_id=3D7477&alloc_id=3D16492&op=3Dclick
_______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer
|
|
From: Andy D. <an...@ma...> - 2005-06-21 21:27:18
|
As I track this problem further, I see that it lies Hibernate3's
SessionFactoryUtils. SessionFactoryUtils has an inner class,
"SpringSessionSynchronization", that is instantiated and registered against
the current transaction when using Spring for session management. During
transaction suspend and resume, this implementation will *always* call
TransactionSynchronizationManager.unbindResource(this.sessionFactory) and
TransactionSynchronizationManager.bindResource(this.sessionFactory,
this.sessionHolder), respectively. When Spring performs a commit, it calls
synchronization methods in this order:
1. beforeCommit
2. beforeCompletion
3. afterCompletion
In beforeCompletion, SpringSessionSynchronization will
unbindResource(this.sessionFactory), and sometimes close the Hibernate
Session. However, SpringSessionSynchronization will not reflect this in its
internal state in any way. Now imagine that a TransactionSynchronization
implementation suspends the transaction in afterCompletion.
SessionFactoryUtils.SpringSessionSynchronization will have its suspend method
called, which will attempt to unbindResource(this.sessionFactory), causing an
exception since it has already been unbound. Moreover, even if it performed
a check and did not unbind the resource, resume() would still attempt to
rebind the resource (whose Hibernate Session was most likely closed in
beforeCompletion), leaving that closed resource bound to the current thread
even after the main transaction has been committed.
Basically, SpringSessionSynchronization needs to be modified to handle this
call sequence:
1. beforeCommit
2. beforeCompletion
3. suspend
4. resume
5. afterCompletion
Which it does not now support (though this was working in older versions of
Spring). I'm willing to open a JIRA issue, make these changes, and submit a
patch if no one has a problem with them.
- Andy
On Monday 20 June 2005 03:28 pm, Andy Depue wrote:
> I'm attempting to do some advanced transaction synchronization. During
> synchronization, I need to update a status row in a DB table. Of course,
> since DB access is itself transactional, I create a new transaction for the
> duration of the update using PROPAGATION_REQUIRES_NEW. The problem occurs
> when I attempt to execute this in "afterCompletion". I sometimes get this
> exception:
> java.lang.IllegalStateException: No value for key
> [org.hibernate.impl.SessionFactoryImpl@1f37bf1] bound to thread [Timer-3]
>
> Here is an abbreviated version of my code:
>
> ------------
> TransactionSynchronizationManager.registerSynchronization(new
> TransactionSynchronization() {
>
> public void suspend() { }
> public void resume() { }
> public void beforeCommit(boolean readOnly)
> {
> getTransactionTemplate().execute(new
> TransactionCallbackWithoutResult() {
> protected void doInTransactionWithoutResult(final
> TransactionStatus status) {
> update("update m_t set trans_time=null where trans_id=?",
> new Object[] { transId });
> }
> });
> }
> public void beforeCompletion() { }
> public void afterCompletion(final int status) {
> getTransactionTemplate().execute(new
> TransactionCallbackWithoutResult() {
> protected void doInTransactionWithoutResult(final
> TransactionStatus ts) {
> if(status == STATUS_ROLLED_BACK) {
> update("update m_t set s_last=trans_s_start, trans_id=null,
> trans_time=null where trans_id=?",
> new Object[] { transId} );
> } else {
> update("update m_t set trans_id=null, trans_time=null,
> trans_s_start=null where trans_id=?",
> new Object[] { transId });
> }
> }
> });
> }
> });
> ---------------
>
> The TransactionTemplate returned from getTransactionTemplate() was created
> like this:
> transactionTemplate = new TransactionTemplate(transactionManager);
>
> transactionTemplate.setPropagationBehavior(TransactionDefinition.PROPAGATIO
>N_REQUIRES_NEW);
> transactionTemplate.setTimeout(getTransactionTimeoutInMs());
> transactionTemplate.setReadOnly(false);
>
>
> My question is, should I be able to do this? The exception is not thrown
> in many cases - however, in this particular case, an exception was thrown
> via other code in the context of the main transaction, though it did not
> cause a rollback to occur, so the transaction was in the process of being
> committed - and while committing the main transaction, the process of
> starting a new transaction caused this related exception to be thrown.
> This is against Spring 1.2.1.
>
> - Andy
>
> PS. Here is a full stack trace, for what its worth:
> java.lang.IllegalStateException: No value for key
> [org.hibernate.impl.SessionFactoryImpl@1f37bf1] bound to thread [Timer-3]
> at
> org.springframework.transaction.support.TransactionSynchronizationManager.u
>nbindResource(TransactionSynchronizationManager.java:175) at
> org.springframework.orm.hibernate3.SessionFactoryUtils$SpringSessionSynchro
>nization.suspend(SessionFactoryUtils.java:846) at
> org.springframework.transaction.support.AbstractPlatformTransactionManager.
>suspend(AbstractPlatformTransactionManager.java:350) at
> org.springframework.transaction.support.AbstractPlatformTransactionManager.
>getExistingTransaction(AbstractPlatformTransactionManager.java:271) at
> org.springframework.transaction.support.AbstractPlatformTransactionManager.
>getTransaction(AbstractPlatformTransactionManager.java:215) at
> org.springframework.transaction.support.TransactionTemplate.execute(Transac
>tionTemplate.java:111) at
> com.marathon.service.dao.jdbc.PSDAO$2.afterCompletion(PSDAO.java:185) at
> org.springframework.transaction.support.AbstractPlatformTransactionManager.
>triggerAfterCompletion(AbstractPlatformTransactionManager.java:610) at
> org.springframework.transaction.support.AbstractPlatformTransactionManager.
>commit(AbstractPlatformTransactionManager.java:467) at
> org.springframework.transaction.interceptor.TransactionAspectSupport.doClos
>eTransactionAfterThrowing(TransactionAspectSupport.java:294) at
> org.springframework.transaction.interceptor.TransactionInterceptor.invoke(T
>ransactionInterceptor.java:61) at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Reflec
>tiveMethodInvocation.java:144) at
> net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor
>.invoke(MethodSecurityInterceptor.java:80) at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Reflec
>tiveMethodInvocation.java:144) at
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopPr
>oxy.java:174) at $Proxy58.postApproved(Unknown Source)
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
> from IBM. Find simple to follow Roadmaps, straightforward articles,
> informative Webcasts and more! Get everything you need to get up to
> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
|
|
From: Darren D. <da...@sh...> - 2005-06-21 16:45:13
|
1119363815
FAILED
[junit] Testcase: testProxiedUserInterfacesWithMultipleInterfaces took 0.041 sec
[junit] Testcase: testProxiedUserInterfacesWithNoInterface took 0.017 sec
[junit] Tests run: 15, Failures: 1, Errors: 0, Time elapsed: 44.477 sec
[junit] Testsuite: org.springframework.aop.framework.CglibProxyTests
[junit] Tests run: 15, Failures: 1, Errors: 0, Time elapsed: 44.477 sec
[junit] ------------- Standard Output ---------------
[junit] StopWatch '': running time (millis) = 27226
[junit] [class org.springframework.aop.framework.CglibProxyTests.testManyProxies: create 10000 proxies] took 27226=100%
[junit] ------------- ---------------- ---------------
[junit] Testcase: testNullConfig took 0.343 sec
[junit] Testcase: testNoTarget took 0.027 sec
[junit] Testcase: testProtectedMethodInvocation took 3.003 sec
[junit] Testcase: testProxyCanBeClassNotInterface took 1.593 sec
[junit] Testcase: testCglibProxyingGivesMeaningfulExceptionIfAskedToProxyNonvisibleClass took 0.255 sec
[junit] Testcase: testMethodInvocationDuringConstructor took 0.54 sec
[junit] Testcase: testUnadvisedProxyCreationWithCallDuringConstructor took 0.522 sec
[junit] Testcase: testMultipleProxies took 1.653 sec
[junit] Testcase: testWithNoArgConstructor took 0.748 sec
[junit] Testcase: testProxyAProxy took 1.479 sec
[junit] Testcase: testExceptionHandling took 0.14 sec
[junit] Testcase: testWithDependencyChecking took 6.644 sec
[junit] Testcase: testNoInterceptorsAndNoTarget took 0.001 sec
[junit] Testcase: testValuesStick took 0.026 sec
[junit] Testcase: testManyProxies took 27.252 sec
[junit] FAILED
[junit] Proxy creation was too slow
[junit] junit.framework.AssertionFailedError: Proxy creation was too slow
[junit] at org.springframework.aop.framework.AbstractAopProxyTests.testManyProxies(AbstractAopProxyTests.java:147)
This is an automated mail from one of the SF Compile Farm machines.
The machine name noted in the subject encountered a failure building
or running the Spring test suite. The last few lines of the output
were included for info.
NB: No further mail will be sent from this machine until a
manual reset occurs on the cf-shell machine, although builds will
continue as scheduled.
See http://springframework.sourceforge.net/test/ for further
information.
|
|
From: Ryan T. <rya...@gm...> - 2005-06-21 07:16:10
|
If you're working in an environment which has Java 1.5/5 available, it's fairly trivial to create a base dao similar to the example here - http://www.ericburke.com/blog/2004/11/hibernate-and-java-5.html and the HibernateTemplate class (referenced above) to provide your basic CRUD operations for an access object. At this point, essentially all that remains are your complex queries (I'd advise against using a criteria query for anything more than moderate load). On 6/20/05, Steve Stallion <sst...@gm...> wrote: > I really do mean something like that ;) >=20 > A good 90% (or more depending on the complexity of a given operation) of > hibernate dao ops can be mapped directly to named queries in the hbm > descriptor. I sat down last nite and jammed out a quick proxy that would > intercept method calls on the dao interface and then map to the named > queries without requiring a concrete dao impl. >=20 > My interest in this is to prevent having to write the 'glue' for the > majority of my hibernate dao impls. The code tends to be quite > repetitive, and can be removed entirely by using the method described abo= ve. >=20 > Hope this helps, >=20 > Steve >=20 > James Estes wrote: > > I assume by "autowiring" you mean the ability to pass in a bean and the > > named parameters are automagically pulled from the bean and bound to th= e > > named query. If so, you might have a look at the > > findByNamedQueryAndValueBean method on HibernateTemplate: > > > > http://static.springframework.org/spring/docs/1.2.x/api/org/springframe= work/orm/hibernate/HibernateTemplate.html#findByNamedQueryAndValueBean(java= .lang.String,%20java.lang.Object) > > <http://static.springframework.org/spring/docs/1.2.x/api/org/springfram= ework/orm/hibernate/HibernateTemplate.html#findByNamedQueryAndValueBean(jav= a.lang.String,%20java.lang.Object)> > > > > Just for clarity...when I hear "autowire" I think "dependencies injecte= d > > from spring managed beans in the container". Unless you really do mea= n > > something like that? > > > > James > > > > > > On 6/19/05, *Steve Stallion* <sst...@gm... > > <mailto:sst...@gm...>> wrote: > > > > hello all, > > > > i am about to start on a project aimed at simplyfing hibernate dao > > integration into spring. The general idea is to provide autowiring = for > > named queries to a given dao interface - ive been quite suprised th= is > > hasnt been done yet. > > > > is anyone aware if this has indeed been proposed, or if so, if ther= e are > > any implementations available already? > > > > > > thanks! > > > > Steve > > > > -- > > Yet magic and hierarchy > > arise from the same source, > > and this source has a null pointer. > > > > Reference the NULL within NULL, > > it is the gateway to all wizardry. > > > > > > ------------------------------------------------------- > > SF.Net <http://SF.Net> email is sponsored by: Discover Easy Linux > > Migration Strategies > > from IBM. Find simple to follow Roadmaps, straightforward articles, > > informative Webcasts and more! Get everything you need to get up to > > speed, fast. http://ads.osdn.com/?ad_id=3D7477&alloc_id=3D16492&op= =3Dclick > > <http://ads.osdn.com/?ad_id=3D7477&alloc_id=3D16492&op=3Dclick> > > _______________________________________________ > > Springframework-developer mailing list > > Spr...@li... > > <mailto:Spr...@li...> > > https://lists.sourceforge.net/lists/listinfo/springframework-develo= per > > <https://lists.sourceforge.net/lists/listinfo/springframework-devel= oper> > > > > >=20 > -- > Yet magic and hierarchy > arise from the same source, > and this source has a null pointer. >=20 > Reference the NULL within NULL, > it is the gateway to all wizardry. >=20 >=20 > ------------------------------------------------------- > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > from IBM. Find simple to follow Roadmaps, straightforward articles, > informative Webcasts and more! Get everything you need to get up to > speed, fast. http://ads.osdn.com/?ad_id=3D7477&alloc_id=3D16492&op=3Dclic= k > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > |
|
From: Andy D. <an...@ma...> - 2005-06-20 23:26:55
|
I have some additional information on this exception. It appears that during
transaction committment things are left in an inconsistent state between the
time that AbstractPlatformTransactionManager.processCommit(...) calls
triggerBeforeCompletion(...) and the time it calls
triggerAfterCompletion(...) - though it is not
AbstractPlatformTransactionManager's fault. In my case, one of the
TransactionSynchronizations attached to the transaction is
org.springframework.orm.hibernate3.SessionFactoryUtils. This class's
implementation of beforeCompletion() invokes
TransactionSynchronizationManager.unbindResource(this.sessionFactory). If
you then attempt to suspend the transaction in a TransactionSynchronization
implementation's afterCompletion method (as I do), you will get an exception
since SessionFactoryUtils' suspend() implementation will blindly call
TransactionSynchronizationManager.unbindResource(this.sessionFactory). Of
course, since beforeCompletion() already did this, the sessionFactory is no
longer bound to the transaction, thus the exception is thrown. Following is
a log with detailed debug output (and comments):
2005-06-20 14:22:54,355 DEBUG
[org.springframework.transaction.support.TransactionSynchronizationManager]
Bound value [org.springframework.orm.hibernate3.SessionHolder@383c13] for key
[org.hibernate.impl.SessionFactoryImpl@1f37bf1] to thread [Timer-3]
2005-06-20 14:22:54,355 DEBUG
[org.springframework.transaction.jta.JtaTransactionManager] Resuming JTA
transaction
2005-06-20 14:22:54,355 DEBUG [com.marathon.service.dao.jdbc.PSDAO]
-----++++]]]]>>>> TRACKING (synchronizing) with caller's transaction...
2005-06-20 14:22:54,355 DEBUG [com.marathon.service.dao.jdbc.PSDAO]
-----++++]]]]>>>> ENTERING
PSDAO.synchronizeWithTransaction(org.springframework.transaction.support.DefaultTransactionStatus@1e6356d)
... Apparently, the parent service code threw an exception at this point ...
2005-06-20 14:22:54,359 DEBUG
[org.springframework.transaction.interceptor.RuleBasedTransactionAttribute]
Applying rules to determine whether transaction should rollback on
com.marathon.AlreadyPostedException: Unable to perform operation: this entry
has already been submitted.
2005-06-20 14:22:54,359 DEBUG
[org.springframework.transaction.interceptor.RuleBasedTransactionAttribute]
Winning rollback rule is: null
2005-06-20 14:22:54,360 DEBUG
[org.springframework.transaction.interceptor.RuleBasedTransactionAttribute]
No relevant rollback rule found: applying superclass default
2005-06-20 14:22:54,360 DEBUG
[org.springframework.transaction.interceptor.TransactionInterceptor]
com.marathon.EntryManager.postApproved threw throwable
[com.marathon.AlreadyPostedException: Unable to perform operation: this entry
has already been submitted.] but this does not force transaction rollback
... Notice that the exception did not cause a rollback
2005-06-20 14:22:54,360 DEBUG
[org.springframework.transaction.jta.JtaTransactionManager] Triggering
beforeCommit synchronization
2005-06-20 14:22:54,360 DEBUG
[org.springframework.orm.hibernate3.SessionFactoryUtils] Flushing Hibernate
Session on transaction synchronization
2005-06-20 14:22:54,365 DEBUG [com.marathon.service.dao.jdbc.PSDAO]
-----++++]]]]>>>> ENTERING
PSDAO.TransactionSynchronization.beforeCommit(false)
... At this point, our TransactionSynchronization starts a new transaction
using REQUIRES_NEW, causing the current transaction to suspend.
2005-06-20 14:22:54,367 DEBUG
[org.springframework.transaction.jta.JtaTransactionManager] Using transaction
object [org.springframework.transaction.jta.JtaTransactionObject@bd7173]
2005-06-20 14:22:54,367 DEBUG
[org.springframework.transaction.jta.JtaTransactionManager] Creating new
transaction, suspending current one
2005-06-20 14:22:54,367 DEBUG
[org.springframework.transaction.jta.JtaTransactionManager] Suspending JTA
transaction
2005-06-20 14:22:54,368 DEBUG
[org.springframework.transaction.support.TransactionSynchronizationManager]
Removed value [org.springframework.orm.hibernate3.SessionHolder@383c13] for
key [org.hibernate.impl.SessionFactoryImpl@1f37bf1] from thread [Timer-3]
2005-06-20 14:22:54,368 DEBUG
[org.springframework.transaction.support.TransactionSynchronizationManager]
Clearing transaction synchronization
2005-06-20 14:22:54,368 DEBUG
[org.springframework.transaction.jta.JtaTransactionManager] Beginning JTA
transaction
2005-06-20 14:22:54,368 DEBUG
[org.springframework.transaction.support.TransactionSynchronizationManager]
Initializing transaction synchronization
2005-06-20 14:22:54,368 DEBUG
[org.springframework.jdbc.datasource.DataSourceUtils] Opening JDBC Connection
2005-06-20 14:22:54,369 DEBUG
[org.springframework.jdbc.datasource.DataSourceUtils] Registering transaction
synchronization for JDBC Connection
2005-06-20 14:22:54,369 DEBUG
[org.springframework.transaction.support.TransactionSynchronizationManager]
Bound value [org.springframework.jdbc.datasource.ConnectionHolder@2b3223] for
key [org.jboss.resource.adapter.jdbc.WrapperDataSource@bed1fd] to thread
[Timer-3]
2005-06-20 14:22:54,371 DEBUG
[org.springframework.transaction.support.TransactionSynchronizationManager]
Retrieved value [org.springframework.jdbc.datasource.ConnectionHolder@2b3223]
for key [org.jboss.resource.adapter.jdbc.WrapperDataSource@bed1fd] bound to
thread [Timer-3]
... Our new transaction uses straight SQL (no Hibernate) and completes
successfully...
2005-06-20 14:22:54,371 DEBUG
[org.springframework.transaction.jta.JtaTransactionManager] Triggering
beforeCommit synchronization
2005-06-20 14:22:54,371 DEBUG
[org.springframework.transaction.jta.JtaTransactionManager] Triggering
beforeCompletion synchronization
2005-06-20 14:22:54,371 DEBUG
[org.springframework.transaction.support.TransactionSynchronizationManager]
Removed value [org.springframework.jdbc.datasource.ConnectionHolder@2b3223]
for key [org.jboss.resource.adapter.jdbc.WrapperDataSource@bed1fd] from
thread [Timer-3]
2005-06-20 14:22:54,371 DEBUG
[org.springframework.jdbc.datasource.DataSourceUtils] Closing JDBC Connection
2005-06-20 14:22:54,371 DEBUG
[org.springframework.transaction.jta.JtaTransactionManager] Initiating
transaction commit
2005-06-20 14:22:54,371 DEBUG
[org.springframework.transaction.jta.JtaTransactionManager] Committing JTA
transaction
2005-06-20 14:22:54,373 DEBUG
[org.springframework.transaction.jta.JtaTransactionManager] Triggering
afterCompletion synchronization
2005-06-20 14:22:54,373 DEBUG
[org.springframework.transaction.support.TransactionSynchronizationManager]
Clearing transaction synchronization
... Our new transaction committed without problems, so the main transaction is
now resumed...
2005-06-20 14:22:54,373 DEBUG
[org.springframework.transaction.jta.JtaTransactionManager] Resuming
suspended transaction
2005-06-20 14:22:54,373 DEBUG
[org.springframework.transaction.support.TransactionSynchronizationManager]
Initializing transaction synchronization
2005-06-20 14:22:54,373 DEBUG
[org.springframework.transaction.support.TransactionSynchronizationManager]
Bound value [org.springframework.orm.hibernate3.SessionHolder@383c13] for key
[org.hibernate.impl.SessionFactoryImpl@1f37bf1] to thread [Timer-3]
... Notice that the SessionFactoryImpl key that causes our woe later on is set
back up properly.
2005-06-20 14:22:54,373 DEBUG
[org.springframework.transaction.jta.JtaTransactionManager] Resuming JTA
transaction
2005-06-20 14:22:54,373 DEBUG
[org.springframework.transaction.jta.JtaTransactionManager] Triggering
beforeCompletion synchronization
2005-06-20 14:22:54,373 DEBUG
[org.springframework.transaction.support.TransactionSynchronizationManager]
Removed value [org.springframework.orm.hibernate3.SessionHolder@383c13] for
key [org.hibernate.impl.SessionFactoryImpl@1f37bf1] from thread [Timer-3]
... At this point, it appears that Hibernate's synchronization code has
removed the infamous SessionFactoryImpl key from the
TransactionSynchronizationManager, however, as we will see later,
Hibernate3's TransactionSynchronization implementation (SessionFactoryUtils)
still holds a reference to this SessionFactoryImpl, and will try to call
TransactionSynchronizationManager.unbindResource with it once we attempt to
suspend the transaction.
2005-06-20 14:22:54,373 DEBUG
[org.springframework.transaction.jta.JtaTransactionManager] Triggering
afterCompletion synchronization
2005-06-20 14:22:54,374 DEBUG
[org.springframework.orm.hibernate3.SessionFactoryUtils] Closing Hibernate
Session
2005-06-20 14:22:54,374 DEBUG [com.marathon.service.dao.jdbc.PSDAO]
-----++++]]]]>>>> ENTERING
PSDAO.TransactionSynchronization.afterCompletion(0)
... Here we have entered our custom TransactionSynchronization.afterCompletion
method, and will attempt to enter our REQUIRES_NEW TransactionTemplate
(causing the current transaction to suspend)...
2005-06-20 14:22:54,377 DEBUG
[org.springframework.transaction.jta.JtaTransactionManager] Using transaction
object [org.springframework.transaction.jta.JtaTransactionObject@9b415c]
2005-06-20 14:22:54,377 DEBUG
[org.springframework.transaction.jta.JtaTransactionManager] Creating new
transaction, suspending current one
2005-06-20 14:22:54,377 DEBUG
[org.springframework.transaction.jta.JtaTransactionManager] Suspending JTA
transaction
2005-06-20 14:22:54,377 DEBUG
[org.springframework.transaction.support.TransactionSynchronizationManager]
Clearing transaction synchronization
2005-06-20 14:22:54,378 WARN java.lang.IllegalStateException: No value for
key [org.hibernate.impl.SessionFactoryImpl@1f37bf1] bound to thread [Timer-3]
On Monday 20 June 2005 03:28 pm, Andy Depue wrote:
> I'm attempting to do some advanced transaction synchronization. During
> synchronization, I need to update a status row in a DB table. Of course,
> since DB access is itself transactional, I create a new transaction for the
> duration of the update using PROPAGATION_REQUIRES_NEW. The problem occurs
> when I attempt to execute this in "afterCompletion". I sometimes get this
> exception:
> java.lang.IllegalStateException: No value for key
> [org.hibernate.impl.SessionFactoryImpl@1f37bf1] bound to thread [Timer-3]
>
> Here is an abbreviated version of my code:
>
> ------------
> TransactionSynchronizationManager.registerSynchronization(new
> TransactionSynchronization() {
>
> public void suspend() { }
> public void resume() { }
> public void beforeCommit(boolean readOnly)
> {
> getTransactionTemplate().execute(new
> TransactionCallbackWithoutResult() {
> protected void doInTransactionWithoutResult(final
> TransactionStatus status) {
> update("update m_t set trans_time=null where trans_id=?",
> new Object[] { transId });
> }
> });
> }
> public void beforeCompletion() { }
> public void afterCompletion(final int status) {
> getTransactionTemplate().execute(new
> TransactionCallbackWithoutResult() {
> protected void doInTransactionWithoutResult(final
> TransactionStatus ts) {
> if(status == STATUS_ROLLED_BACK) {
> update("update m_t set s_last=trans_s_start, trans_id=null,
> trans_time=null where trans_id=?",
> new Object[] { transId} );
> } else {
> update("update m_t set trans_id=null, trans_time=null,
> trans_s_start=null where trans_id=?",
> new Object[] { transId });
> }
> }
> });
> }
> });
> ---------------
>
> The TransactionTemplate returned from getTransactionTemplate() was created
> like this:
> transactionTemplate = new TransactionTemplate(transactionManager);
>
> transactionTemplate.setPropagationBehavior(TransactionDefinition.PROPAGATIO
>N_REQUIRES_NEW);
> transactionTemplate.setTimeout(getTransactionTimeoutInMs());
> transactionTemplate.setReadOnly(false);
>
>
> My question is, should I be able to do this? The exception is not thrown
> in many cases - however, in this particular case, an exception was thrown
> via other code in the context of the main transaction, though it did not
> cause a rollback to occur, so the transaction was in the process of being
> committed - and while committing the main transaction, the process of
> starting a new transaction caused this related exception to be thrown.
> This is against Spring 1.2.1.
>
> - Andy
>
> PS. Here is a full stack trace, for what its worth:
> java.lang.IllegalStateException: No value for key
> [org.hibernate.impl.SessionFactoryImpl@1f37bf1] bound to thread [Timer-3]
> at
> org.springframework.transaction.support.TransactionSynchronizationManager.u
>nbindResource(TransactionSynchronizationManager.java:175) at
> org.springframework.orm.hibernate3.SessionFactoryUtils$SpringSessionSynchro
>nization.suspend(SessionFactoryUtils.java:846) at
> org.springframework.transaction.support.AbstractPlatformTransactionManager.
>suspend(AbstractPlatformTransactionManager.java:350) at
> org.springframework.transaction.support.AbstractPlatformTransactionManager.
>getExistingTransaction(AbstractPlatformTransactionManager.java:271) at
> org.springframework.transaction.support.AbstractPlatformTransactionManager.
>getTransaction(AbstractPlatformTransactionManager.java:215) at
> org.springframework.transaction.support.TransactionTemplate.execute(Transac
>tionTemplate.java:111) at
> com.marathon.service.dao.jdbc.PSDAO$2.afterCompletion(PSDAO.java:185) at
> org.springframework.transaction.support.AbstractPlatformTransactionManager.
>triggerAfterCompletion(AbstractPlatformTransactionManager.java:610) at
> org.springframework.transaction.support.AbstractPlatformTransactionManager.
>commit(AbstractPlatformTransactionManager.java:467) at
> org.springframework.transaction.interceptor.TransactionAspectSupport.doClos
>eTransactionAfterThrowing(TransactionAspectSupport.java:294) at
> org.springframework.transaction.interceptor.TransactionInterceptor.invoke(T
>ransactionInterceptor.java:61) at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Reflec
>tiveMethodInvocation.java:144) at
> net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor
>.invoke(MethodSecurityInterceptor.java:80) at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Reflec
>tiveMethodInvocation.java:144) at
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopPr
>oxy.java:174) at $Proxy58.postApproved(Unknown Source)
|
|
From: <al...@in...> - 2005-06-20 22:30:59
|
View results here -> http://opensource.jteam.nl/build/buildresults/spring?log=log20050621001701Lbuild.288 |
|
From: Andy D. <an...@ma...> - 2005-06-20 22:28:32
|
I'm attempting to do some advanced transaction synchronization. During
synchronization, I need to update a status row in a DB table. Of course,
since DB access is itself transactional, I create a new transaction for the
duration of the update using PROPAGATION_REQUIRES_NEW. The problem occurs
when I attempt to execute this in "afterCompletion". I sometimes get this
exception:
java.lang.IllegalStateException: No value for key
[org.hibernate.impl.SessionFactoryImpl@1f37bf1] bound to thread [Timer-3]
Here is an abbreviated version of my code:
------------
TransactionSynchronizationManager.registerSynchronization(new
TransactionSynchronization() {
public void suspend() { }
public void resume() { }
public void beforeCommit(boolean readOnly)
{
getTransactionTemplate().execute(new
TransactionCallbackWithoutResult() {
protected void doInTransactionWithoutResult(final TransactionStatus
status) {
update("update m_t set trans_time=null where trans_id=?",
new Object[] { transId });
}
});
}
public void beforeCompletion() { }
public void afterCompletion(final int status) {
getTransactionTemplate().execute(new
TransactionCallbackWithoutResult() {
protected void doInTransactionWithoutResult(final TransactionStatus
ts) {
if(status == STATUS_ROLLED_BACK) {
update("update m_t set s_last=trans_s_start, trans_id=null,
trans_time=null where trans_id=?",
new Object[] { transId} );
} else {
update("update m_t set trans_id=null, trans_time=null,
trans_s_start=null where trans_id=?",
new Object[] { transId });
}
}
});
}
});
---------------
The TransactionTemplate returned from getTransactionTemplate() was created
like this:
transactionTemplate = new TransactionTemplate(transactionManager);
transactionTemplate.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW);
transactionTemplate.setTimeout(getTransactionTimeoutInMs());
transactionTemplate.setReadOnly(false);
My question is, should I be able to do this? The exception is not thrown in
many cases - however, in this particular case, an exception was thrown via
other code in the context of the main transaction, though it did not cause a
rollback to occur, so the transaction was in the process of being committed -
and while committing the main transaction, the process of starting a new
transaction caused this related exception to be thrown.
This is against Spring 1.2.1.
- Andy
PS. Here is a full stack trace, for what its worth:
java.lang.IllegalStateException: No value for key
[org.hibernate.impl.SessionFactoryImpl@1f37bf1] bound to thread [Timer-3]
at
org.springframework.transaction.support.TransactionSynchronizationManager.unbindResource(TransactionSynchronizationManager.java:175)
at
org.springframework.orm.hibernate3.SessionFactoryUtils$SpringSessionSynchronization.suspend(SessionFactoryUtils.java:846)
at
org.springframework.transaction.support.AbstractPlatformTransactionManager.suspend(AbstractPlatformTransactionManager.java:350)
at
org.springframework.transaction.support.AbstractPlatformTransactionManager.getExistingTransaction(AbstractPlatformTransactionManager.java:271)
at
org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:215)
at
org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:111)
at com.marathon.service.dao.jdbc.PSDAO$2.afterCompletion(PSDAO.java:185)
at
org.springframework.transaction.support.AbstractPlatformTransactionManager.triggerAfterCompletion(AbstractPlatformTransactionManager.java:610)
at
org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:467)
at
org.springframework.transaction.interceptor.TransactionAspectSupport.doCloseTransactionAfterThrowing(TransactionAspectSupport.java:294)
at
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:61)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
at
net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:80)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174)
at $Proxy58.postApproved(Unknown Source)
|
|
From: Dmitriy K. <dko...@ru...> - 2005-06-20 20:43:39
|
Thanks Rob. D. Rob Harrop wrote: > They didn't get committed - reattempting now. > > See sandbox/tests/o/s/aop/support/aspectj > > Dmitriy Kopylenko wrote: > >> Rob, >> >> could you point me where the tests are? >> >> Thanks, >> Dmitriy. >> >> Rob Harrop wrote: >> >>> All, >>> >>> I added AspectJ5 pointcut support to the sandbox. Please try it out >>> with the supplied aspectjweaver.jar. >>> >>> The tests demonstrate how to configure the AJ pointcuts. >>> >>> Note that these classes will not be released until AJ5 is final. >>> >>> Rob >>> >>> >>> ------------------------------------------------------- >>> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies >>> from IBM. Find simple to follow Roadmaps, straightforward articles, >>> informative Webcasts and more! Get everything you need to get up to >>> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click >>> _______________________________________________ >>> Springframework-developer mailing list >>> Spr...@li... >>> https://lists.sourceforge.net/lists/listinfo/springframework-developer >> >> >> >> >> >> >> ------------------------------------------------------- >> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies >> from IBM. Find simple to follow Roadmaps, straightforward articles, >> informative Webcasts and more! Get everything you need to get up to >> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click >> _______________________________________________ >> Springframework-developer mailing list >> Spr...@li... >> https://lists.sourceforge.net/lists/listinfo/springframework-developer > > |
|
From: Rob H. <rob...@in...> - 2005-06-20 20:40:39
|
They didn't get committed - reattempting now. See sandbox/tests/o/s/aop/support/aspectj Dmitriy Kopylenko wrote: > Rob, > > could you point me where the tests are? > > Thanks, > Dmitriy. > > Rob Harrop wrote: > >> All, >> >> I added AspectJ5 pointcut support to the sandbox. Please try it out >> with the supplied aspectjweaver.jar. >> >> The tests demonstrate how to configure the AJ pointcuts. >> >> Note that these classes will not be released until AJ5 is final. >> >> Rob >> >> >> ------------------------------------------------------- >> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies >> from IBM. Find simple to follow Roadmaps, straightforward articles, >> informative Webcasts and more! Get everything you need to get up to >> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click >> _______________________________________________ >> Springframework-developer mailing list >> Spr...@li... >> https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > > > > ------------------------------------------------------- > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > from IBM. Find simple to follow Roadmaps, straightforward articles, > informative Webcasts and more! Get everything you need to get up to > speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer -- Rob Harrop Interface21 - Spring Services from the Source |
|
From: Dmitriy K. <dko...@ru...> - 2005-06-20 20:20:22
|
Rob, could you point me where the tests are? Thanks, Dmitriy. Rob Harrop wrote: > All, > > I added AspectJ5 pointcut support to the sandbox. Please try it out > with the supplied aspectjweaver.jar. > > The tests demonstrate how to configure the AJ pointcuts. > > Note that these classes will not be released until AJ5 is final. > > Rob > > > ------------------------------------------------------- > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > from IBM. Find simple to follow Roadmaps, straightforward articles, > informative Webcasts and more! Get everything you need to get up to > speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Steve S. <sst...@gm...> - 2005-06-20 19:04:20
|
I really do mean something like that ;) A good 90% (or more depending on the complexity of a given operation) of hibernate dao ops can be mapped directly to named queries in the hbm descriptor. I sat down last nite and jammed out a quick proxy that would intercept method calls on the dao interface and then map to the named queries without requiring a concrete dao impl. My interest in this is to prevent having to write the 'glue' for the majority of my hibernate dao impls. The code tends to be quite repetitive, and can be removed entirely by using the method described above. Hope this helps, Steve James Estes wrote: > I assume by "autowiring" you mean the ability to pass in a bean and the > named parameters are automagically pulled from the bean and bound to the > named query. If so, you might have a look at the > findByNamedQueryAndValueBean method on HibernateTemplate: > > http://static.springframework.org/spring/docs/1.2.x/api/org/springframework/orm/hibernate/HibernateTemplate.html#findByNamedQueryAndValueBean(java.lang.String,%20java.lang.Object) > <http://static.springframework.org/spring/docs/1.2.x/api/org/springframework/orm/hibernate/HibernateTemplate.html#findByNamedQueryAndValueBean(java.lang.String,%20java.lang.Object)> > > Just for clarity...when I hear "autowire" I think "dependencies injected > from spring managed beans in the container". Unless you really do mean > something like that? > > James > > > On 6/19/05, *Steve Stallion* <sst...@gm... > <mailto:sst...@gm...>> wrote: > > hello all, > > i am about to start on a project aimed at simplyfing hibernate dao > integration into spring. The general idea is to provide autowiring for > named queries to a given dao interface - ive been quite suprised this > hasnt been done yet. > > is anyone aware if this has indeed been proposed, or if so, if there are > any implementations available already? > > > thanks! > > Steve > > -- > Yet magic and hierarchy > arise from the same source, > and this source has a null pointer. > > Reference the NULL within NULL, > it is the gateway to all wizardry. > > > ------------------------------------------------------- > SF.Net <http://SF.Net> email is sponsored by: Discover Easy Linux > Migration Strategies > from IBM. Find simple to follow Roadmaps, straightforward articles, > informative Webcasts and more! Get everything you need to get up to > speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click > <http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click> > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > <mailto:Spr...@li...> > https://lists.sourceforge.net/lists/listinfo/springframework-developer > <https://lists.sourceforge.net/lists/listinfo/springframework-developer> > > -- Yet magic and hierarchy arise from the same source, and this source has a null pointer. Reference the NULL within NULL, it is the gateway to all wizardry. |
|
From: Rob H. <rob...@in...> - 2005-06-20 18:06:47
|
All, I added AspectJ5 pointcut support to the sandbox. Please try it out with the supplied aspectjweaver.jar. The tests demonstrate how to configure the AJ pointcuts. Note that these classes will not be released until AJ5 is final. Rob |