Announcement Announcement Module
Collapse
No announcement yet.
No CurrentSessionContext configured! on spring 2.5 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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?

    Comment


    • #3
      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>

      Comment

      Working...
      X