Announcement Announcement Module
Collapse
No announcement yet.
"No value for key" error when transaction is turned on for lookup operation Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • "No value for key" error when transaction is turned on for lookup operation

    I have the following simple method in my DAO:

    Code:
    	public void find() {
    		DirContextAdapter context =  (DirContextAdapter)getSimpleLdapTemplate().lookupContext("cn=Charles Zhao");
    		System.out.println("Found: " + context);
    	}
    If transaction propagation for this method is set to "NOT_SUPPORTED", then it works and finds the right context. But if I set it to "REQUIRES_NEW", I am getting the following exception:

    java.lang.IllegalStateException: No value for key [org.springframework.ldap.core.support.LdapContextS ource@1aa0e3b] bound to thread [main]
    at org.springframework.transaction.support.Transactio nSynchronizationManager.unbindResource(Transaction SynchronizationManager.java:184)
    at org.springframework.transaction.compensating.suppo rt.AbstractCompensatingTransactionManagerDelegate. doCleanupAfterCompletion(AbstractCompensatingTrans actionManagerDelegate.java:119)
    at org.springframework.ldap.transaction.compensating. manager.ContextSourceTransactionManager.doCleanupA fterCompletion(ContextSourceTransactionManager.jav a:133)
    at org.springframework.transaction.support.AbstractPl atformTransactionManager.cleanupAfterCompletion(Ab stractPlatformTransactionManager.java:919)
    at org.springframework.transaction.support.AbstractPl atformTransactionManager.processCommit(AbstractPla tformTransactionManager.java:712)
    at org.springframework.transaction.support.AbstractPl atformTransactionManager.commit(AbstractPlatformTr ansactionManager.java:632)
    at org.springframework.transaction.interceptor.Transa ctionAspectSupport.commitTransactionAfterReturning (TransactionAspectSupport.java:314)
    at org.springframework.transaction.interceptor.Transa ctionInterceptor.invoke(TransactionInterceptor.jav a:117)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :161)

    Has anyone had similar issue?

    Thanks,

    Chunyun Zhao
    Last edited by Chunyun Zhao; Apr 15th, 2008, 06:43 PM.

  • #2
    Actually, there is another thread with a similar issue. It looks like there might be an issue with nested transactions. Please create a JIRA issue here. As far as I can see, there was no issue created by the guy in the other thread.

    Comment

    Working...
    X