Spring-MVC, Hibernate : Contents not deleted from database but method fired

Question!

I am working on a Spring-MVC application in which I am using the @Scheduled method to delete the old information(1 week old) from database. The method was fired, and I got an email, but the contents of the database were not deleted.

Also, I got 4 emails, where I should have got one. Any ideas?

DAO Code in question :

@Repository
@Transactional
public class NotificationDAOImpl implements NotificationDAO{


    private SessionFactory sessionFactory;

    public void setSessionFactory(SessionFactory sf){
        this.sessionFactory = sf;
    }

    private Session session;

    public void setSession(Session session){this.session = session;}
    @Override
    @Scheduled(cron = "0 3 3 * * ?")
    public void deleteNotificationsAutoMagically(){
        Emails emails = new Emails();
        emails.sendEmailForNotificationDelete();
        session=this.sessionFactory.getCurrentSession();
        long now = System.currentTimeMillis();
        long nowMinus1Week = now - (1000 * 60 * 60 * 24 * 7);
        Timestamp nowMinus1WeekAsTimeStamp = new Timestamp(nowMinus1Week);
        Query query = session.createQuery("delete from NoteLock as nl where nl.timestamp<:limit");
        query.setParameter("limit", nowMinus1WeekAsTimeStamp);
        query.executeUpdate();
        session.flush();
    } 
}

Email code :

     public void sendEmailForNotificationDelete(){
            final String from = "[email protected]";
            final String emailPassword = "password";

            Properties props = new Properties();

            props.put("mail.smtp.starttls.enable", "true");
            props.put("mail.smtp.auth", "true");
            props.put("mail.smtp.host", "mail.delink-ssl.net");
            props.put("mail.smtp.starttls.enable", "true");
            props.put("mail.smtp.port", "25");

            Session session = Session.getDefaultInstance(props,
                    new Authenticator() {
                        protected PasswordAuthentication getPasswordAuthentication() {
                            return new PasswordAuthentication(
                                    from, emailPassword);
                        }
                    });
            try {
                MimeMessage message = new MimeMessage(session);
                message.setFrom(new InternetAddress(from));
                message.addRecipient(Message.RecipientType.TO, new InternetAddress("[email protected]"));
                message.setSubject("Notifications were deleted");
                String messageToSend = "Notifications were deleted";
                message.setContent(messageToSend, "text/html;charset=UTF-8");
                Transport.send(message);
            }catch (Exception ignored){

            }
        }

Any help would be nice. Thanks a lot.

Edit

servlet-context.xml :

<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/mvc"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xmlns:beans="http://www.springframework.org/schema/beans"
             xmlns:context="http://www.springframework.org/schema/context"
             xmlns:tx="http://www.springframework.org/schema/tx"
             xmlns:mvc="http://www.springframework.org/schema/mvc"
             xmlns:task="http://www.springframework.org/schema/task"
             xsi:schemaLocation="http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
         http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans.xsd
         http://www.springframework.org/schema/context 
http://www.springframework.org/schema/context/spring-context.xsd
         http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
http://www.springframework.org/schema/task
http://www.springframework.org/schema/task/spring-task.xsd">


    <context:annotation-config/>

    <mvc:annotation-driven>
        <mvc:argument-resolvers>
            <beans:bean class="org.springframework.mobile.device.DeviceWebArgumentResolver"/>
        </mvc:argument-resolvers>
    </mvc:annotation-driven>


    <mvc:interceptors>
        <beans:bean class="org.springframework.mobile.device.DeviceResolverHandlerInterceptor"/>
    </mvc:interceptors>

    <mvc:default-servlet-handler/>

    <resources mapping="/resources/" location="/resources/"/>

    <beans:bean
            class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <beans:property name="prefix" value="/WEB-INF/views/"/>
        <beans:property name="suffix" value=".jsp"/>
    </beans:bean>

    <beans:bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
                destroy-method="close">
        <beans:property name="driverClassName" value="org.postgresql.Driver"/>
        <beans:property name="url"
                        value="jdbc:postgresql://localhost:5432/dbname"/>
        <beans:property name="username" value="dbuser"/>
        <beans:property name="password" value="dbpass"/>
        <beans:property name="removeAbandoned" value="true"/>
        <beans:property name="removeAbandonedTimeout" value="20"/>
        <beans:property name="defaultAutoCommit" value="false"/>
    </beans:bean>


    <!-- Hibernate 4 SessionFactory Bean definition -->
    <beans:bean id="hibernate4AnnotatedSessionFactory"
                class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
        <beans:property name="dataSource" ref="dataSource"/>
        <beans:property name="annotatedClasses">
            <beans:list>
                <beans:value>com.journaldev.spring.model.Person</beans:value>
                <beans:value>com.journaldev.spring.model.Notes</beans:value>
                <beans:value>com.journaldev.spring.model.Canvas</beans:value>
                <beans:value>com.journaldev.spring.model.Section</beans:value>
                <beans:value>com.journaldev.spring.model.Attachment</beans:value>

                <beans:value>com.journaldev.spring.model.GroupAccount</beans:value>
                <beans:value>com.journaldev.spring.model.GroupMembers</beans:value>
                <beans:value>com.journaldev.spring.model.GroupCanvas</beans:value>
                <beans:value>com.journaldev.spring.model.GroupSection</beans:value>
                <beans:value>com.journaldev.spring.model.GroupNotes</beans:value>
                <beans:value>com.journaldev.spring.model.GroupAttachments
                </beans:value>

                <beans:value>com.journaldev.spring.model.Token</beans:value>
                <beans:value>com.journaldev.spring.model.WaitingMembers
                </beans:value>
                <beans:value>com.journaldev.spring.model.NoteHistory</beans:value>
                <beans:value>com.journaldev.spring.model.GroupNoteHistory
                </beans:value>

                <beans:value>com.journaldev.spring.model.Feedback</beans:value>
                <beans:value>com.journaldev.spring.model.UnreadNotes</beans:value>
                <beans:value>com.journaldev.spring.model.SessionState</beans:value>
                <beans:value>com.journaldev.spring.model.FeatureRequest
                </beans:value>
                <beans:value>com.journaldev.spring.model.FeatureComment
                </beans:value>
                <beans:value>com.journaldev.spring.model.FeatureLike</beans:value>
                <beans:value>com.journaldev.spring.model.OnlineUsers</beans:value>
                <beans:value>com.journaldev.spring.model.NoteCount</beans:value>
                <beans:value>com.journaldev.spring.model.NoteLock</beans:value>
                <beans:value>com.journaldev.spring.model.ChatMessages</beans:value>
                <beans:value>com.journaldev.spring.model.Conversation</beans:value>
                <beans:value>com.journaldev.spring.model.Replies</beans:value>
                <beans:value>com.journaldev.spring.model.Notification</beans:value>
                <beans:value>com.journaldev.spring.model.Statistics</beans:value>
                <beans:value>com.journaldev.spring.model.PrivateChannel</beans:value>
                <!--<beans:value>com.journaldev.spring.model.GroupChannels</beans:value>-->
            </beans:list>
        </beans:property>
        <beans:property name="hibernateProperties">
            <beans:props>
                <beans:prop key="hibernate.dialect">org.hibernate.dialect.PostgreSQL9Dialect
                </beans:prop>
                <beans:prop key="hibernate.show_sql">false</beans:prop>
                <beans:prop key="connection.pool_size">200</beans:prop>
                <beans:prop key="c3p0.max_size">200</beans:prop>
                <beans:prop key="c3p0.timeout">1000</beans:prop>
                   <beans:prop key="hibernate.jdbc.batch_size">1000</beans:prop>
                    <beans:prop key="hibernate.order_updates">true</beans:prop>
                <beans:prop key="hibernate.hbm2ddl.auto">update</beans:prop>
            </beans:props>
        </beans:property>
    </beans:bean>

    <task:annotation-driven/>

    <tx:annotation-driven transaction-manager="transactionManager"/>

    <beans:bean id="transactionManager"
                class="org.springframework.orm.hibernate4.HibernateTransactionManager">
        <beans:property name="sessionFactory" ref="hibernate4AnnotatedSessionFactory"/>
    </beans:bean>

    <!-- Person beans being here -->
    <beans:bean id="personDAO" class="com.journaldev.spring.dao.PersonDAOImpl">
        <beans:property name="sessionFactory"
                        ref="hibernate4AnnotatedSessionFactory"/>
    </beans:bean>
    <beans:bean id="personService"
                class="com.journaldev.spring.service.PersonServiceImpl">
        <beans:property name="personDAO" ref="personDAO"/>
    </beans:bean>


    <!--  <beans:bean id="bayeux" class="org.cometd.server.BayeuxServerImpl" init-method="start" destroy-method="stop">
          <beans:property name="transports">
              <beans:list>
                  <beans:bean id="jsonTransport" class="org.cometd.server.transport.JSONTransport">
                      <beans:constructor-arg ref="bayeux"/>
                  </beans:bean>
                  <beans:bean id="jsonpTransport" class="org.cometd.server.transport.JSONPTransport">
                      <beans:constructor-arg ref="bayeux"/>
                  </beans:bean>
              </beans:list>
        </beans:property>
      </beans:bean>-->

    <!-- Group Account beans begin here -->

    <beans:bean id="groupAccountDAO"
                class="com.journaldev.spring.dao.GroupAccountDAOImpl">
        <beans:property name="sessionFactory"
                        ref="hibernate4AnnotatedSessionFactory"/>
    </beans:bean>

    <beans:bean id="groupAccountService"
                class="com.journaldev.spring.service.GroupAccountServiceImpl">
        <beans:property name="groupAccountDAO" ref="groupAccountDAO"/>
    </beans:bean>

    <!--Group Members bean begin here -->
    <beans:bean id="groupMembersDAO"
                class="com.journaldev.spring.dao.GroupMembersDAOImpl">
        <beans:property name="sessionFactory"
                        ref="hibernate4AnnotatedSessionFactory"/>
    </beans:bean>

    <beans:bean id="groupMembersService"
                class="com.journaldev.spring.service.GroupMembersServiceImpl">
        <beans:property name="groupMembersDAO" ref="groupMembersDAO"/>
    </beans:bean>

    <!-- Notes bean begin here -->
    <beans:bean id="notesDAO" class="com.journaldev.spring.dao.NotesDAOImpl">
        <beans:property name="sessionFactory"
                        ref="hibernate4AnnotatedSessionFactory"/>
    </beans:bean>

    <beans:bean id="notesService"
                class="com.journaldev.spring.service.NotesServiceImpl">
        <beans:property name="notesDAO" ref="notesDAO"/>
    </beans:bean>

    <!--GroupNotes begin here -->

    <beans:bean id="groupNotesDAO" class="com.journaldev.spring.dao.GroupNotesDAOImpl">
        <beans:property name="sessionFactory"
                        ref="hibernate4AnnotatedSessionFactory"/>
    </beans:bean>

    <beans:bean id="groupNotesService"
                class="com.journaldev.spring.service.GroupNotesServiceImpl">
        <beans:property name="groupNotesDAO" ref="groupNotesDAO"/>
    </beans:bean>


    <!-- Canvas Beans begin here -->

    <beans:bean id="canvasDAO" class="com.journaldev.spring.dao.CanvasDAOImpl">
        <beans:property name="sessionFactory"
                        ref="hibernate4AnnotatedSessionFactory"/>
    </beans:bean>

    <beans:bean id="canvasService"
                class="com.journaldev.spring.service.CanvasServiceImpl">
        <beans:property name="canvasDAO" ref="canvasDAO"/>
    </beans:bean>

    <!--Group Canvas beans begin here -->
    <beans:bean id="groupCanvasDAO"
                class="com.journaldev.spring.dao.GroupCanvasDAOImpl">
        <beans:property name="sessionFactory"
                        ref="hibernate4AnnotatedSessionFactory"/>
    </beans:bean>

    <beans:bean id="groupCanvasService"
                class="com.journaldev.spring.service.GroupCanvasServiceImpl">
        <beans:property name="groupCanvasDAO" ref="groupCanvasDAO"/>
    </beans:bean>

    <!-- Section beans begin here -->
    <beans:bean id="sectionDAO" class="com.journaldev.spring.dao.SectionDAOImpl">
        <beans:property name="sessionFactory"
                        ref="hibernate4AnnotatedSessionFactory"/>
    </beans:bean>

    <beans:bean id="sectionService"
                class="com.journaldev.spring.service.SectionServiceImpl">
        <beans:property name="sectionDAO" ref="sectionDAO"/>
    </beans:bean>

    <!-- Group Section beans begin here -->
    <beans:bean id="groupSectionDAO"
                class="com.journaldev.spring.dao.GroupSectionDAOImpl">
        <beans:property name="sessionFactory"
                        ref="hibernate4AnnotatedSessionFactory"/>
    </beans:bean>

    <beans:bean id="groupSectionService"
                class="com.journaldev.spring.service.GroupSectionServiceImpl">
        <beans:property name="groupSectionDAO" ref="groupSectionDAO"/>
    </beans:bean>


    <beans:bean id="tokenDAO" class="com.journaldev.spring.dao.TokenDAOImpl">
        <beans:property name="sessionFactory"
                        ref="hibernate4AnnotatedSessionFactory"/>
    </beans:bean>

    <beans:bean id="tokenService"
                class="com.journaldev.spring.service.TokenServiceImpl">
        <beans:property name="tokenDAO" ref="tokenDAO"/>
    </beans:bean>


    <beans:bean id="attachDAO" class="com.journaldev.spring.dao.AttachmentDAOImpl">
        <beans:property name="sessionFactory"
                        ref="hibernate4AnnotatedSessionFactory"/>
    </beans:bean>

    <beans:bean id="attachService"
                class="com.journaldev.spring.service.AttachmentServiceImpl">
        <beans:property name="attachmentDAO" ref="attachDAO"/>
    </beans:bean>


    <beans:bean id="mattachDAO"
                class="com.journaldev.spring.dao.GroupAttachmentsDAOImpl">
        <beans:property name="sessionFactory"
                        ref="hibernate4AnnotatedSessionFactory"/>
    </beans:bean>

    <beans:bean id="mattachService"
                class="com.journaldev.spring.service.GroupAttachmentsServiceImpl">
        <beans:property name="groupAttachmentsDAO" ref="mattachDAO"/>
    </beans:bean>

    <beans:bean id="waitingDAO"
                class="com.journaldev.spring.dao.WaitingMembersDAOImpl">
        <beans:property name="sessionFactory"
                        ref="hibernate4AnnotatedSessionFactory"/>
    </beans:bean>

    <beans:bean id="waitingService"
                class="com.journaldev.spring.service.WaitingMembersServiceImpl">
        <beans:property name="waitingMembersDAO" ref="waitingDAO"/>
    </beans:bean>

    <beans:bean id="historyDAO"
                class="com.journaldev.spring.dao.NoteHistoryDAOImpl">
        <beans:property name="sessionFactory"
                        ref="hibernate4AnnotatedSessionFactory"/>
    </beans:bean>

    <beans:bean id="historyService"
                class="com.journaldev.spring.service.NoteHistoryServiceImpl">
        <beans:property name="noteHistoryDAO" ref="historyDAO"/>
    </beans:bean>

    <beans:bean id="mhistoryDAO"
                class="com.journaldev.spring.dao.GroupNoteHistoryDAOImpl">
        <beans:property name="sessionFactory"
                        ref="hibernate4AnnotatedSessionFactory"/>
    </beans:bean>

    <beans:bean id="mhistoryService"
                class="com.journaldev.spring.service.GroupNoteHistoryServiceImpl">
        <beans:property name="groupNoteHistoryDAO" ref="mhistoryDAO"/>
    </beans:bean>


    <beans:bean id="feedbackDAO" class="com.journaldev.spring.dao.FeedbackDAOImpl">
        <beans:property name="sessionFactory"
                        ref="hibernate4AnnotatedSessionFactory"/>
    </beans:bean>

    <beans:bean id="feedbackService"
                class="com.journaldev.spring.service.FeedbackServiceImpl">
        <beans:property name="feedbackDAO" ref="feedbackDAO"/>
    </beans:bean>


    <beans:bean id="unreadDAO"
                class="com.journaldev.spring.dao.UnreadNotesDAOImpl">
        <beans:property name="sessionFactory"
                        ref="hibernate4AnnotatedSessionFactory"/>
    </beans:bean>


    <beans:bean id="unreadService"
                class="com.journaldev.spring.service.UnreadNotesServiceImpl">
        <beans:property name="unreadNotesDAO" ref="unreadDAO"/>
    </beans:bean>

    <beans:bean id="sessionStateDAO"
                class="com.journaldev.spring.dao.SessionStateDAOImpl">
        <beans:property name="sessionFactory"
                        ref="hibernate4AnnotatedSessionFactory"/>
    </beans:bean>

    <beans:bean id="sessionService"
                class="com.journaldev.spring.service.SessionStateServiceImpl">
        <beans:property name="sessionStateDAO" ref="sessionStateDAO"/>
    </beans:bean>


    <beans:bean id="featuresDAO"
                class="com.journaldev.spring.dao.FeatureRequestDAOImpl">
        <beans:property name="sessionFactory"
                        ref="hibernate4AnnotatedSessionFactory"/>
    </beans:bean>

    <beans:bean id="featuresService"
                class="com.journaldev.spring.service.FeatureRequestServiceImpl">
        <beans:property name="featureRequestDAO" ref="featuresDAO"/>
    </beans:bean>


    <beans:bean id="featureCommentDAO"
                class="com.journaldev.spring.dao.FeatureCommentDAOImpl">
        <beans:property name="sessionFactory"
                        ref="hibernate4AnnotatedSessionFactory"/>
    </beans:bean>

    <beans:bean id="featureCommentService"
                class="com.journaldev.spring.service.FeatureCommentServiceImpl">
        <beans:property name="featureCommentDAO" ref="featureCommentDAO"/>
    </beans:bean>

    <beans:bean id="featureLikeDAO"
                class="com.journaldev.spring.dao.FeatureLikeDAOImpl">
        <beans:property name="sessionFactory"
                        ref="hibernate4AnnotatedSessionFactory"/>
    </beans:bean>

    <beans:bean id="featureLikeService"
                class="com.journaldev.spring.service.FeatureLikeServiceImpl">
        <beans:property name="featureLikeDAO" ref="featureLikeDAO"/>
    </beans:bean>


    <beans:bean id="onlineUsersDAO"
                class="com.journaldev.spring.dao.OnlineUsersDAOImpl">
        <beans:property name="sessionFactory"
                        ref="hibernate4AnnotatedSessionFactory"/>
    </beans:bean>

    <beans:bean id="onlineUsersService"
                class="com.journaldev.spring.service.OnlineUsersServiceImpl">
        <beans:property name="onlineUsersDAO" ref="onlineUsersDAO"/>
    </beans:bean>

    <beans:bean id="noteCountDAO" class="com.journaldev.spring.dao.NoteCountDAOImpl">
        <beans:property name="sessionFactory"
                        ref="hibernate4AnnotatedSessionFactory"/>
    </beans:bean>

    <beans:bean id="noteCountService"
                class="com.journaldev.spring.service.NoteCountServiceImpl">
        <beans:property name="noteCountDAO" ref="noteCountDAO"/>
    </beans:bean>


    <beans:bean id="noteLockDAO" class="com.journaldev.spring.dao.NoteLockDAOImpl">
        <beans:property name="sessionFactory"
                        ref="hibernate4AnnotatedSessionFactory"/>
    </beans:bean>

    <beans:bean id="noteLockService"
                class="com.journaldev.spring.service.NoteLockServiceImpl">
        <beans:property name="noteLockDAO" ref="noteLockDAO"/>
    </beans:bean>


    <beans:bean id="chatDAO" class="com.journaldev.spring.dao.ChatMessagesDAOImpl">
        <beans:property name="sessionFactory" ref="hibernate4AnnotatedSessionFactory"/>
    </beans:bean>

    <beans:bean id="chatService" class="com.journaldev.spring.service.ChatMessagesServiceImpl">
        <beans:property name="chatDAO" ref="chatDAO"/>
    </beans:bean>


    <beans:bean id="conversationDAO" class="com.journaldev.spring.dao.ConversationDAOImpl">
        <beans:property name="sessionFactory" ref="hibernate4AnnotatedSessionFactory"/>
    </beans:bean>

    <beans:bean id="conversationService" class="com.journaldev.spring.service.ConversationServiceImpl">
        <beans:property name="conversationDAO" ref="conversationDAO"/>
    </beans:bean>

    <beans:bean id="repliesDAO" class="com.journaldev.spring.dao.RepliesDAOImpl">
        <beans:property name="sessionFactory" ref="hibernate4AnnotatedSessionFactory"/>
    </beans:bean>

    <beans:bean id="repliesService" class="com.journaldev.spring.service.RepliesServiceImpl">
        <beans:property name="repliesDAO" ref="repliesDAO"/>
    </beans:bean>


    <beans:bean id="notificationDAO" class="com.journaldev.spring.dao.NotificationDAOImpl">
        <beans:property name="sessionFactory" ref="hibernate4AnnotatedSessionFactory"/>
    </beans:bean>

    <beans:bean id="notificationService" class="com.journaldev.spring.service.NotificationServiceImpl">
        <beans:property name="notificationDAO" ref="notificationDAO"/>
    </beans:bean>


    <beans:bean id="statisticsDAO" class="com.journaldev.spring.dao.StatisticsDAOImpl">
        <beans:property name="sessionFactory" ref="hibernate4AnnotatedSessionFactory"/>
    </beans:bean>

    <beans:bean id="statisticsService" class="com.journaldev.spring.service.StatisticsServiceImpl">
        <beans:property name="statisticsDAO" ref="statisticsDAO"/>
    </beans:bean>


    <beans:bean id="privateChannelDAO" class="com.journaldev.spring.dao.PrivateChannelDAOImpl">
        <beans:property name="sessionFactory" ref="hibernate4AnnotatedSessionFactory"/>
    </beans:bean>

    <beans:bean id="privateChannelService" class="com.journaldev.spring.service.PrivateChannelServiceImpl">
        <beans:property name="privateChannelDAO" ref="privateChannelDAO"/>
    </beans:bean>


 <!--   <beans:bean id="groupChannelsDAO" class="com.journaldev.spring.dao.GroupChannelsDAOImpl">
        <beans:property name="sessionFactory" ref="hibernate4AnnotatedSessionFactory"/>
    </beans:bean>

    <beans:bean id="groupChannelsService" class="com.journaldev.spring.service.GroupChannelsServiceImpl">
        <beans:property name="groupChannelsDAO" ref="groupChannelsDAO"/>
    </beans:bean>-->

    <!--<beans:bean id="chatBean" class="com.journaldev.spring.chat.ChatServiceImpl"/>-->

    <!--Login bean -->
    <beans:bean id="LoginServiceImpl"
                class="com.journaldev.spring.service.LoginServiceImpl"/>

    <context:component-scan base-package="com.journaldev.spring"/>

    <!-- locale -->
    <beans:bean id="messageSource"
                class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
        <beans:property name="basename" value="classpath:/locale/messages"/>
        <beans:property name="defaultEncoding" value="UTF-8"/>
    </beans:bean>

    <context:property-placeholder location="classpath:application.properties"/>

    <!-- default locale -->
    <beans:bean id="localeResolver"
                class="org.springframework.web.servlet.i18n.SessionLocaleResolver">
        <beans:property name="defaultLocale" value="de"/>
    </beans:bean>

    <!-- Change locale via url. -->
    <beans:bean id="localeChangeInterceptor"
                class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
        <beans:property name="paramName" value="lang"/>
    </beans:bean>

    <beans:bean id="handlerMapping"
                class="org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping">
        <beans:property name="interceptors">
            <beans:list>
                <beans:ref bean="localeChangeInterceptor"/>
            </beans:list>
        </beans:property>
    </beans:bean>

    <beans:bean class="com.journaldev.spring.service.DoNotTruncateMyUrls"/>

    <beans:bean id="multipartResolver"
                class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
        <beans:property name="maxUploadSize" value="52428800"/>
    </beans:bean>

    <beans:bean
            class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter">
        <beans:property name="messageConverters" ref="jsonMessageConverter"/>
    </beans:bean>

    <beans:bean id="jsonMessageConverter"
                class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter"/>

</beans:beans>


Answers

Your problem might be that @Scheduled and @Transactional don't play well together if they are declared for the same method.

Try to externalize the scheduled method into another bean and use an autowired instance of your dao (which has the transactional method)



I think you @Transactional annotation isn't "taking effect". Reasons being:

You are defining beans in the XML file, but also using

By : Mecon


This video can help you solving your question :)
By: admin