Results 1 to 3 of 3

Thread: No CurrentSessionContext configured! on spring 2.5

  1. #1

    Question No CurrentSessionContext configured! on spring 2.5

    Hi, guys.
    I'm trying to test my workin' with spring 2.0.5 code with spring 2.5.

    applicationContext.xml contains
    Code:
    <tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="true"/>
    and my class contains
    Code:
    	@Transactional(readOnly = false, propagation = Propagation.REQUIRED)
    	public List getAllData() {
    
    		try {
    
    			String queryString = "from Data";
    			Query queryObject = this.sessionFactory.getCurrentSession()
    					.createQuery(queryString);
    			return queryObject.list();
    
    		} catch (RuntimeException re) {
    			logger.debug("getting all data failed");
    			logger.debug(re.getMessage());
    		}
    		return null;
    	}
    and i see a message "No CurrentSessionContext configured!" in logs. Whats goin' on? How can i correct it?

  2. #2
    Join Date
    Jun 2008
    Posts
    25

    Default Good Question, is there an answer for this yet?

    I'm having the same problem. I see this was posted in 2007 but no one has replied. Any advice on this?

  3. #3
    Join Date
    Jun 2008
    Posts
    25

    Default I found my problem

    I'm not sure about the other dude's problem, but I just found the solution to mine.

    I had the hibernate.current_session_context_class=thread but I needed:

    Code:
    				<prop key="hibernate.current_session_context_class">org.springframework.orm.hibernate3.SpringSessionContext</prop>

Posting Permissions

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