Announcement Announcement Module
No announcement yet.
"No value for key" error when transaction is turned on for lookup operation Page Title Module
Move Remove Collapse
Conversation Detail Module
  • 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:

    	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 [ ource@1aa0e3b] bound to thread [main]
    at nSynchronizationManager.unbindResource(Transaction
    at org.springframework.transaction.compensating.suppo rt.AbstractCompensatingTransactionManagerDelegate. doCleanupAfterCompletion(AbstractCompensatingTrans
    at org.springframework.ldap.transaction.compensating. manager.ContextSourceTransactionManager.doCleanupA fterCompletion(ContextSourceTransactionManager.jav a:133)
    at atformTransactionManager.cleanupAfterCompletion(Ab
    at atformTransactionManager.processCommit(AbstractPla
    at atformTransactionManager.commit(AbstractPlatformTr
    at org.springframework.transaction.interceptor.Transa ctionAspectSupport.commitTransactionAfterReturning (
    at org.springframework.transaction.interceptor.Transa ctionInterceptor.invoke(TransactionInterceptor.jav a:117)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed( :161)

    Has anyone had similar issue?


    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.