Results 1 to 2 of 2

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

Hybrid View

  1. #1

    Default "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 at 06:43 PM.

  2. #2
    Join Date
    Jul 2005
    Location
    Helsingborg, Sweden
    Posts
    504

    Default

    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.
    Ulrik Sandberg
    Jayway (www.jayway.com)
    Spring LDAP project member

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •