MYSQL+IBATIS+SPRING+VAADIN

I joined all spring getting the bean writing


package com.persistencia.dao;

import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.orm.ibatis.SqlMapClientTemplate;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.dominio.myBean;
import com.excepcion.ExcepcionDao;
import com.persistencia.iface.IMyFaceDAO;

public class MyBeanDAO extends SqlMapClientDaoSupport implements IMyFaceDAO {

	SqlMapClientTemplate templateSpring = this.getSqlMapClientTemplate();
	public static Log logger = LogFactory.getFactory().getInstance(
			MyBeanDAO.class);
	........................
	@Override
	public List<MyBean> findAll() throws ExcepcionDao {
		// TODO Auto-generated method stub
		try {
			templateSpring = this.getSqlMapClientTemplate();
			@SuppressWarnings("unchecked")
			List<MyBean> listMyBean = templateSpring.queryForList(
					"getMyBeans", null);
			return listMyBeans;
		} catch (Exception e) {
			logger.error(e.getMessage());
			e.printStackTrace();
			throw new ExcepcionDao(e.getMessage());

		}
	}
         ...................................
}

and service


public class ServiceMyBean{
	
	private MyBeanDAO myBeanDAO;
	
	public ServicioRegion() {
		
	}
	public List<MyBean> getListMyBeans() throws ExcepcionDao {
		return myBeanDAO.findAll();
	}
       ..........................get ......and ........set ...and + functions

}

and vaadin


..............


import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.io.Serializable;

import javax.servlet.ServletContext;
import org.springframework.context.ApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

import  com.vaadin.*;
import com.vaadin.terminal.gwt.server.WebApplicationContext;

public class SpringVaadin {
	
    

	private ApplicationContext context;

    public SpringVaadin(Application  application) {
        ServletContext servletContext = 
                ((WebApplicationContext) application.getContext())
                .getHttpSession().getServletContext();
        context = WebApplicationContextUtils.
                getRequiredWebApplicationContext(servletContext);
    }

    public Object getBean(final String beanRef) {
        return context.getBean(beanRef);
    }

	 
}

in Vaadin


.....
public BeanItemContainer<MyBean> getListaMyBean() {
		List<MyBean> lista = null;
		try {
			lista = this.getControlador().getServiceMyBean()
					.getListMyBeans();
		} catch (ExcepcionDao e) {

			e.printStackTrace();
		}
		BeanItemContainer<MyBean> cr = new BeanItemContainer<MyBean>(lista);
		return cr;
	}
....

and vaadin main application


	@Override
	public void init() {
		ctx = new SpringVaadin(this);
		control = (MyControl) ctx.getBean("controlVaadin");
                ............
              ......

	}
.........................

...............................Table.setContainerDataSource(control.getListaMyBean())...

Is OK, work fine but:

all data remains until the end of the session is correct?

you can change the session time?

when you finish the session at that time instanante I update my data?

someone with more experience I can advise