Comments (4)
Can you please add the thread name (or id) to the log?
from spring.
Thanks for replied, I add some log in my Service Implementation, and here is the log:
2013-05-16 10:02:41 973 DEBUG: com.ssports.db.TransTest - Invoking service method[addRecords]
2013-05-16 10:02:41 973 DEBUG: com.ssports.db.TransTest - Thread Name: main
2013-05-16 10:02:41 973 DEBUG: com.ssports.db.TransTest - Thread id: 1
2013-05-16 10:02:41 976 DEBUG: org.springframework.jdbc.datasource.DataSourceTransactionManager - Creating new transaction with name [com.ssports.test.service.TestServiceImpl.addRecords]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT
2013-05-16 10:02:41 977 DEBUG: org.springframework.jdbc.datasource.DataSourceTransactionManager - Acquired Connection [org.apache.commons.dbcp.PoolableConnection@5ea4007a] for JDBC transaction
2013-05-16 10:02:41 979 DEBUG: org.springframework.jdbc.datasource.DataSourceTransactionManager - Switching JDBC Connection [org.apache.commons.dbcp.PoolableConnection@5ea4007a] to manual commit
2013-05-16 10:02:41 980 DEBUG: com.ssports.test.service.TestServiceImpl - Thread Name: main
2013-05-16 10:02:41 980 DEBUG: com.ssports.test.service.TestServiceImpl - Thread id: 1
2013-05-16 10:02:41 980 INFO : com.ssports.test.service.TestServiceImpl - 4:1368669761
2013-05-16 10:02:41 981 DEBUG: org.mybatis.spring.SqlSessionUtils - Creating a new SqlSession
2013-05-16 10:02:41 981 DEBUG: org.mybatis.spring.SqlSessionUtils - Registering transaction synchronization for SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@7ffb0a21]
2013-05-16 10:02:41 984 DEBUG: org.mybatis.spring.transaction.SpringManagedTransaction - JDBC Connection [org.apache.commons.dbcp.PoolableConnection@bc691e0] will be managed by Spring
2013-05-16 10:02:41 984 DEBUG: com.ssports.test.mapper.RecordMapper.insert - ooo Using Connection [org.apache.commons.dbcp.PoolableConnection@bc691e0]
2013-05-16 10:02:41 985 DEBUG: com.ssports.test.mapper.RecordMapper.insert - ==> Preparing: insert into test (id, content, position, time) values (?, ?, ?, ?)
2013-05-16 10:02:41 985 DEBUG: com.ssports.test.mapper.RecordMapper.insert - ==> Parameters: null, ddd(String), 4(Integer), 1368669761(Integer)
2013-05-16 10:02:42 036 DEBUG: org.mybatis.spring.SqlSessionUtils - Releasing transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@7ffb0a21]
2013-05-16 10:02:42 036 DEBUG: com.ssports.test.service.TestServiceImpl - Thread Name: main
2013-05-16 10:02:42 036 DEBUG: com.ssports.test.service.TestServiceImpl - Thread id: 1
2013-05-16 10:02:42 036 INFO : com.ssports.test.service.TestServiceImpl - 0:1368164281
2013-05-16 10:02:42 036 DEBUG: org.mybatis.spring.SqlSessionUtils - Fetched SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@7ffb0a21] from current transaction
2013-05-16 10:02:42 036 DEBUG: com.ssports.test.mapper.RecordMapper.insert - ooo Using Connection [org.apache.commons.dbcp.PoolableConnection@bc691e0]
2013-05-16 10:02:42 037 DEBUG: com.ssports.test.mapper.RecordMapper.insert - ==> Preparing: insert into test (id, content, position, time) values (?, ?, ?, ?)
2013-05-16 10:02:42 037 DEBUG: com.ssports.test.mapper.RecordMapper.insert - ==> Parameters: null, test(String), 0(Integer), 1368164281(Integer)
2013-05-16 10:02:42 113 DEBUG: org.mybatis.spring.SqlSessionUtils - Releasing transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@7ffb0a21]
2013-05-16 10:02:42 114 DEBUG: org.springframework.jdbc.datasource.DataSourceTransactionManager - Initiating transaction rollback
2013-05-16 10:02:42 114 DEBUG: org.springframework.jdbc.datasource.DataSourceTransactionManager - Rolling back JDBC transaction on Connection [org.apache.commons.dbcp.PoolableConnection@5ea4007a]
2013-05-16 10:02:42 114 DEBUG: org.mybatis.spring.SqlSessionUtils - Transaction synchronization rolling back SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@7ffb0a21]
2013-05-16 10:02:42 114 DEBUG: org.mybatis.spring.SqlSessionUtils - Transaction synchronization closing SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@7ffb0a21]
2013-05-16 10:02:42 115 DEBUG: org.springframework.jdbc.datasource.DataSourceTransactionManager - Releasing JDBC Connection [org.apache.commons.dbcp.PoolableConnection@5ea4007a] after transaction
2013-05-16 10:02:42 115 DEBUG: com.ssports.db.TransTest - Exception throw
from spring.
I also raise a question on stackoverflow.com, and here is the link, which you can find more details on my sample project code. hope it'll give some help.
from spring.
It can be closed now, I found that there is something wrong with my service Implementation that I start the context twice. sorry for bother.
from spring.
Related Issues (20)
- mapperLocations is overwritten HOT 1
- SqlSessionFactoryBean single resource, using wildcard causes a IOException HOT 4
- When Spring has multiple ApplicationContexts, it may throw BeanCreationNotAllowedException HOT 1
- Update dependency org.mybatis:mybatis to v3.5.13 on 2.1.x
- fix: change the event type that SqlSessionFactory is listening to on 2.1.x
- Drop support 1.3.x and 2.0.x
- Support processPropertyPlaceHolders option in mapper:scan and @MapperScan
- does mybatis-spring support to use customized mapper excludeFilters? HOT 1
- The logic regarding transaction rollback seems incorrect HOT 3
- The latest springboot using mybatis-spring-stater 3.0.2 throw exception "Invalid value type for attribute 'factoryBeanObjectType': java.lang.String" HOT 6
- The first query of maybatis takes longer than the second query. How to warm up in advance? HOT 1
- Switch baseline to Spring 6.1 and Spring Batch 5.1
- Support JDK 22 on CI
- why not override postProcessBeanDefinition method in ClassPathMapperScanner
- The latest springboot using mybatis-spring-stater 3.0.3-SNAPSHOT throw exception "Invalid value type for attribute 'factoryBeanObjectType': java.lang.String" HOT 5
- An idea to adapt to Spring 6.1 HOT 3
- MyBatisSystemException message is null
- Why @MapperScan scan all interface? Maybe only scan annotated with @Mapper is better? HOT 2
- mybatis-spring official docs for english responds 404 HOT 8
- spring boot 3.2.x aot problem
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring.