Spring application doesn't appear to be persisting data

后端 未结 6 2095
甜味超标
甜味超标 2021-01-20 13:07

I\'m trying to write something into my database but it\'s not working despite it reporting \"Successfully completed request\". After the success everything seems to work fin

6条回答
  •  不要未来只要你来
    2021-01-20 13:47

    after creating transactionManager bean you should enable the transaction in Xml file,

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

    or

    < tx:annotation-driven />

    if u written 2nd one then you have to use @Transaction() in your DAO class,

    if any method required the transaction then before that write

    @Transactional(propagation=Propagation.REQUIRED, readOnly=false)

    it tell that transaction is require and readOnly=false means you can read and write the data.

提交回复
热议问题