Springmvc+mybatis problem records in the schema

Source: Internet
Author: User

2014/08/16 Record

Today, I have a problem, I'm about 4 hours, good pit, because I haven't met before.

My bag is so divided: Com. project name. Module name. Service.impl In spring Configure this facet execution (* com. Project name. *impl.* (..)) He just can't find COM. project name. Module NAME. Service.impl the following *impl class

And this configuration even wrong, he does not error, and when I test with junit simultaneously, loading three configuration files Springmvc.xml spring.xml spring-mybatis.xml It is normal, once through the Web initialization of the problem, If the web loads three files at the same time, it will not be a problem, and when he does so, only the log files are logged as follows:

debug-sqlsession [[email protected]] was wasn't registered for synchronization because synchronization are not active
Debug-fetching JDBC Connection from DataSource
DEBUG-JDBC Connection [[email protected]] won't is managed by Spring
Debug-ooo Using Connection [[email protected]
DEBUG-==> Preparing:select * from Test where testid=?
DEBUG-==> parameters:1 (Integer)
DEBUG-<== Total:1
debug-closing Non transactional sqlsession [[email protected]]
Debug-returning JDBC Connection to DataSource

When changed to such execution (* com. Project name:  *.*(..)) Then everything returned to normal, and the project name of the execution to change, he did not error, can access the database, the log is like the above

Sqlsession cannot synchronize the connection agent cannot be managed by spring and he can access the database as well, then the connection pool is still valid because his transaction management is invalidated and therefore does not roll back. Therefore, I do not have a system to learn mybatis, the cost of a long time, today to record, in case of errors later, I hope to encounter this problem developers note

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.